<?php /* * Hello World Example * * This example illustrates the basic multi-lingual capabilities of Sitellite. */ // set the page title to the text 'Hello World' // note that intl_get() automatically translates the text based on the // user's preferred languages page_title(intl_get('Hello World')); // insert into breadcrumb navigation page_id('helloworld'); page_below('examples'); // set default language to 'fr' then rebuild 'example' app index global $intl; $intl->language = 'fr'; $intl->getIndex(); // now we output the same text, but it will appear this time in French echo '<p>' . intl_get('Hello World') . '</p>'; // let's reset the language settings now, so the rest of the site continues // in the default language $intl->language = 'en';
// are deleted when the user has received a response. This is ideal for // such uses as community help services (ie. addictions, teen help, etc.). appconf_set('user_anonymity', false); appconf_set('user_age_list', array('blank' => '- SELECT -', 'Under 18' => 'Under 18', '18-24' => '18-24', '25-29' => '25-29', '30-39' => '30-39', '40-49' => '40-49', '50-59' => '50-59', '60-70' => '60-70', 'Over 70' => 'Over 70')); /** * Set this to the template you wish to use to display the app, otherwise * the default is used. */ appconf_set('template', false); /** * Set this to the page ID of the page you would like to be the parent of * the app. This affects the web site navigation while within the * app itself, and the breadcrumb trail as well. */ appconf_set('page_below', false); /** * Set this to the ID of the page which is an alias of the app. */ appconf_set('page_alias', false); if ($context == 'action') { if (appconf('page_below')) { page_below(appconf('page_below')); } if (appconf('page_alias')) { page_id(appconf('page_alias')); } if (appconf('template')) { page_template(appconf('template')); } } appconf_set('format_date_time', 'F jS, Y - g:i A');
unset($info['dirname']); unset($info['basename']); if (empty($info['description'])) { $info['description'] = $info['display_title']; } $res[] = (object) $info; } if ($parameters['title']) { if ($box['context'] == 'action') { page_title($parameters['title']); } else { echo '<h2>' . $parameters['title'] . '</h2>'; } if (appconf('page_alias')) { page_id('sitegallery-pixgallery-action'); page_below(appconf('page_alias')); } } $valid = appconf('valid'); foreach (array_keys($res) as $k) { if (!in_array(strtolower($res[$k]->extension), $valid)) { unset($res[$k]); continue; } $res[$k]->src = sitegallery_get_thumbnail($parameters['path'] . '/' . $res[$k]->name . '.' . $res[$k]->extension); //list ($res[$k]->width, $res[$k]->height) = getimagesize ('pix/' . $parameters['path'] . '/' . $res[$k]->name . '.' . $res[$k]->extension); } template_simple_register('results', $res); page_add_script(site_prefix() . '/inc/app/sitegallery/js/prototype.js'); page_add_script(site_prefix() . '/inc/app/sitegallery/js/scriptaculous.js?load=effects'); page_add_script(site_prefix() . '/inc/app/sitegallery/js/lightbox.js');