/** * Standard modular run function. * * @param array A map of parameters. * @return tempcode The result of execution. */ function run($map) { require_lang('chat'); require_css('side_blocks'); $room_id = array_key_exists('param', $map) ? intval($map['param']) : NULL; $num_messages = array_key_exists('max', $map) ? intval($map['max']) : 5; if (is_null($room_id)) { $room_id = $GLOBALS['SITE_DB']->query_value_null_ok('chat_rooms', 'MIN(id)', array('is_im' => 0)); if (is_null($room_id)) { return new ocp_tempcode(); } } $room_check = $GLOBALS['SITE_DB']->query_select('chat_rooms', array('*'), array('id' => $room_id), '', 1); if (!array_key_exists(0, $room_check)) { return new ocp_tempcode(); } require_code('chat'); if (!check_chatroom_access($room_check[0], true)) { global $DO_NOT_CACHE_THIS; // We don't cache against access, so we have a problem and can't cache $DO_NOT_CACHE_THIS = true; return new ocp_tempcode(); } $content = NULL; if (get_value('no_frames') === '1') { $content = shoutbox_script(true, $room_id, $num_messages); } return do_template('BLOCK_SIDE_SHOUTBOX_IFRAME', array('CONTENT' => $content, 'ROOM_ID' => strval($room_id), 'NUM_MESSAGES' => strval($num_messages))); }
/** * Standard modular run function. * * @return tempcode The result of execution. */ function run() { if (get_forum_type() != 'ocf') { warn_exit(do_lang_tempcode('NO_OCF')); } else { ocf_require_all_forum_stuff(); } require_code('ocf_forumview'); if (is_guest()) { access_denied('NOT_AS_GUEST'); } require_css('ocf'); $type = get_param('type', 'misc'); if ($type == 'misc') { list($title, $content) = $this->new_posts(); } elseif ($type == 'unread') { list($title, $content) = $this->unread_topics(); } elseif ($type == 'recently_read') { list($title, $content) = $this->recently_read(); } else { $title = new ocp_tempcode(); $content = new ocp_tempcode(); } $ret = ocf_wrapper($title, do_template('OCF_VFORUM', array('_GUID' => '8dca548982d65500ab1800ceec2ddc61', 'CONTENT' => $content))); return $ret; }
/** * Standard modular run function. * * @return tempcode The result of execution. */ function run() { require_javascript('javascript_realtime_rain'); require_javascript('javascript_ajax'); require_javascript('javascript_more'); require_lang('realtime_rain'); require_css('realtime_rain'); $title = get_page_title('REALTIME_RAIN'); if (!has_js()) { // Send them to the page permissions screen $url = build_url(array('page' => 'admin_stats', 'type' => 'misc'), '_SELF'); require_code('site2'); assign_refresh($url, 5.0); return do_template('REDIRECT_SCREEN', array('URL' => $url, 'TITLE' => $title, 'TEXT' => do_lang_tempcode('NO_JS_REALTIME'))); } $GLOBALS['TEMPCODE_SETGET']['chrome_frame'] = make_string_tempcode('1'); if (browser_matches('ie6')) { attach_message(do_lang_tempcode('IE_OLD_PLEASE_UPGRADE'), 'warn'); } if (!has_js()) { // Send them to the stats screen $url = build_url(array('page' => 'admin_stats', 'type' => 'misc'), '_SELF'); require_code('site2'); assign_refresh($url, 5.0); return do_template('REDIRECT_SCREEN', array('URL' => $url, 'TITLE' => $title, 'TEXT' => do_lang_tempcode('NO_JS_ADVANCED_SCREEN_REALTIME_RAIN'))); } $min_time = $GLOBALS['SITE_DB']->query_value('stats', 'MIN(date_and_time)'); if (is_null($min_time)) { $min_time = time(); } return do_template('REALTIME_RAIN_OVERLAY', array('MIN_TIME' => strval($min_time))); }
/** * Standard modular run function. * * @param array A map of parameters. * @return tempcode The result of execution. */ function run($map) { require_code('downloads'); require_css('downloads'); require_lang('downloads'); $zone = array_key_exists('zone', $map) ? $map['zone'] : get_module_zone('downloads'); global $NON_CANONICAL_PARAMS; $NON_CANONICAL_PARAMS[] = 'max'; $max = get_param_integer('max', 10); if ($max < 1) { $max = 1; } $start = get_param_integer('start', 0); $rows = $GLOBALS['SITE_DB']->query_select('download_downloads', array('*'), array('validated' => 1), 'ORDER BY num_downloads DESC', $max, $start); $content = new ocp_tempcode(); foreach ($rows as $i => $row) { if ($i != 0) { $content->attach(do_template('BLOCK_SEPARATOR')); } $content->attach(get_download_html($row, true, true, $zone)); } $page_num = intval(floor(floatval($start) / floatval($max))) + 1; $count = $GLOBALS['SITE_DB']->query_value('download_downloads', 'COUNT(*)', array('validated' => 1)); $num_pages = intval(ceil(floatval($count) / floatval($max))); if ($num_pages == 0) { $page_num = 0; } $previous_url = $start == 0 ? new ocp_tempcode() : build_url(array('page' => '_SELF', 'start' => $start - $max), '_SELF'); $next_url = $page_num == $num_pages ? new ocp_tempcode() : build_url(array('page' => '_SELF', 'start' => $start + $max), '_SELF'); $browse = do_template('NEXT_BROWSER_BROWSE_NEXT', array('_GUID' => '15ca70ec400629f67edefa869fb1f1a8', 'NEXT_LINK' => $next_url, 'PREVIOUS_LINK' => $previous_url, 'PAGE_NUM' => integer_format($page_num), 'NUM_PAGES' => integer_format($num_pages))); return do_template('BLOCK_MAIN_DOWNLOAD_TEASE', array('_GUID' => 'a164e33c0b4ace4bae945c39f2f00ca9', 'CONTENT' => $content, 'BROWSE' => $browse)); }
/** * Get ready for displaying the skin. * * This may register some CSS or JS... */ function display_init() { // call parent: parent::display_init(); // Add CSS: require_css('basic_styles.css', 'blog'); // the REAL basic styles require_css('basic.css', 'blog'); // Basic styles require_css('blog_base.css', 'blog'); // Default styles for the blog navigation require_css('item_base.css', 'blog'); // Default styles for the post CONTENT require_js('ajax.js', 'blog'); require_js('functions.js'); require_js('rollovers.js'); // Make sure standard CSS is called ahead of custom CSS generated below: require_css('style.css', 'relative'); // Width switch styles add_headline('<link rel="stylesheet" href="style.css" type="text/css" title="fixed"/>'); add_headline('<link rel="alternate stylesheet" href="fluid.css" type="text/css" title="fluid"/>'); add_headline('<script type="text/javascript" src="rsc/js/styleswitcher.js"></script>'); // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images: if ($this->get_setting("colorbox")) { require_js_helper('colorbox', 'blog'); } }
/** * Standard modular run function. * * @param array A map of parameters. * @return tempcode The result of execution. */ function run($map) { unset($map); require_css('side_blocks'); $langs = nice_get_langs(user_lang()); return do_template('BLOCK_SIDE_LANGUAGE', array('_GUID' => '5dd7dd434722d7fd958773bd08e838c7', 'LANGS' => $langs)); }
/** * Standard modular run function. * * @param array A map of parameters. * @return tempcode The result of execution. */ function run($map) { global $NON_CANONICAL_PARAMS; $NON_CANONICAL_PARAMS[] = 'max'; $category_id = array_key_exists('param', $map) ? intval($map['param']) : db_get_first_id(); $max = get_param_integer('max', array_key_exists('max', $map) ? intval($map['max']) : 30); $start = get_param_integer('start', 0); $root = array_key_exists('root', $map) && $map['root'] != '' ? intval($map['root']) : get_param_integer('root', NULL); $sort = array_key_exists('sort', $map) ? $map['sort'] : ''; $search = array_key_exists('search', $map) ? $map['search'] : ''; require_lang('catalogues'); require_code('catalogues'); require_code('feedback'); require_css('catalogues'); $select = NULL; if (!is_null($map) && array_key_exists('select', $map)) { require_code('ocfiltering'); $select = ocfilter_to_sqlfragment($map['select'], 'e.id', 'catalogue_categories', 'cc_parent_id', 'cc_id', 'id'); } $categories = $GLOBALS['SITE_DB']->query_select('catalogue_categories', array('*'), array('id' => $category_id), '', 1); if (!array_key_exists(0, $categories)) { return do_lang_tempcode('MISSING_RESOURCE'); } $category = $categories[0]; $catalogue_name = $category['c_name']; $catalogues = $GLOBALS['SITE_DB']->query_select('catalogues', array('*'), array('c_name' => $catalogue_name), '', 1); $catalogue = $catalogues[0]; $tpl_set = array_key_exists('template_set', $map) ? $map['template_set'] : $catalogue_name; $display_type = array_key_exists('display_type', $map) ? intval($map['display_type']) : NULL; list($entry_buildup, , , ) = get_catalogue_category_entry_buildup(is_null($select) ? $category_id : NULL, $catalogue_name, $catalogue, 'CATEGORY', $tpl_set, $max, $start, $select, $root, $display_type, true, NULL, $search, $sort); return do_template('CATALOGUE_' . $tpl_set . '_CATEGORY_EMBED', array('ROOT' => strval($root), 'CATALOGUE' => $catalogue_name, 'ENTRIES' => $entry_buildup), NULL, false, 'CATALOGUE_DEFAULT_CATEGORY_EMBED'); }
/** * Get ready for displaying the skin. * * This may register some CSS or JS... */ function display_init() { // call parent: parent::display_init(); // We pass NO params. This gives up the default Skins API v5 behavior. require_css('item.css', 'relative'); }
/** * Standard modular run function. * * @param array A map of parameters. * @return tempcode The result of execution. */ function run($map) { require_code('type_validation'); require_lang('phpdoc'); require_code('php'); require_css('adminzone'); disable_php_memory_limit(); $filename = (array_key_exists('param', $map) ? $map['param'] : 'sources/global2') . '.php'; if (substr($filename, -8) == '.php.php') { $filename = substr($filename, 0, strlen($filename) - 4); } $full_path = (get_file_base() != '' ? get_file_base() . '/' : '') . filter_naughty($filename); if (!file_exists($full_path)) { return paragraph(do_lang_tempcode('MISSING_RESOURCE')); } $_classes = get_php_file_api($filename); $classes = new ocp_tempcode(); foreach ($_classes as $class) { if ($class['name'] == '__global') { $class['name'] = do_lang('GLOBAL_FUNCTIONS') . '_' . basename($filename); } $function_summaries = new ocp_tempcode(); $functions = new ocp_tempcode(); foreach ($class['functions'] as $function) { $ret = render_php_function($function, $class); $functions->attach($ret[0]); $function_summaries->attach($ret[1]); } $classes->attach(do_template('PHP_CLASS', array('_GUID' => '5d58fc42c5fd3a5dd190f3f3699610c2', 'CLASS_NAME' => $class['name'], 'FUNCTION_SUMMARIES' => $function_summaries, 'FUNCTIONS' => $functions))); } return do_template('PHP_FILE', array('_GUID' => '6f422e6a6e846d49864d7325b212109f', 'FILENAME' => $filename, 'CLASSES' => $classes)); }
/** * Standard modular run function. * * @return tempcode The result of execution. */ function run() { $type = get_param('type', 'misc'); $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/cedi'; $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_cedi'; require_code('cedi'); require_lang('cedi'); require_css('cedi'); // Decide what to do if ($type == 'misc') { return $this->misc(); } if ($type == 'choose_page_to_edit') { return $this->choose_page_to_edit(); } if ($type == 'add_page') { return $this->add_page(); } if ($type == '_add_page') { return $this->_add_page(); } if ($type == 'edit_page') { return $this->edit_page(); } if ($type == '_edit_page') { return $this->_edit_page(); } if ($type == 'edit_tree') { return $this->edit_tree(); } if ($type == '_edit_tree') { return $this->_edit_tree(); } return new ocp_tempcode(); }
/** * Standard aed_module run_start. * * @param ID_TEXT The type of module execution * @return tempcode The output of the run */ function run_start($type) { $this->cat_aed_module = new Module_cms_calendar_cat(); $this->javascript = "\n\t\t\tvar form=document.getElementById('recurrence_pattern').form;\n\t\t\tvar crf=function() {\n\t\t\t\tvar s=(form.elements['recurrence'][0].checked);\n\t\t\t\tif (form.elements['recurrence_pattern']) form.elements['recurrence_pattern'].disabled=s;\n\t\t\t\tif (form.elements['recurrences']) form.elements['recurrences'].disabled=s;\n\t\t\t\tif (form.elements['seg_recurrences']) form.elements['seg_recurrences'].disabled=s;\n\t\t\t};\n\t\t\tcrf();\n\t\t\tfor (var i=0;i<form.elements['recurrence'].length;i++) form.elements['recurrence'][i].onclick=crf;\n\n\t\t\tvar crf2=function() {\n\t\t\t\tvar s=document.getElementById('all_day_event').checked;\n\t\t\t\tdocument.getElementById('start_hour').disabled=s;\n\t\t\t\tdocument.getElementById('start_minute').disabled=s;\n\t\t\t\tdocument.getElementById('end_hour').disabled=s;\n\t\t\t\tdocument.getElementById('end_minute').disabled=s;\n\t\t\t}\n\t\t\tcrf2();\n\t\t\tdocument.getElementById('all_day_event').onclick=crf2;\n\n\t\t\tform.old_submit=form.onsubmit;\n\t\t\tform.onsubmit=function()\n\t\t\t\t{\n\t\t\t\t\tif (form.elements['end_day'].selectedIndex!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar start=new Date(window.parseInt(form.elements['start_year'].value),window.parseInt(form.elements['start_month'].value)-1,window.parseInt(form.elements['start_day'].value),window.parseInt(form.elements['start_hour'].value),window.parseInt(form.elements['start_minute'].value));\n\t\t\t\t\t\tvar end=new Date(window.parseInt(form.elements['end_year'].value),window.parseInt(form.elements['end_month'].value)-1,window.parseInt(form.elements['end_day'].value),window.parseInt(form.elements['end_hour'].value),window.parseInt(form.elements['end_minute'].value));\n\n\t\t\t\t\t\tif (start>end)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twindow.fauxmodal_alert('" . php_addslashes(do_lang('EVENT_CANNOT_AROUND')) . "');\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof form.old_submit!='undefined' && form.old_submit) return form.old_submit();\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\t\t"; $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/calendar'; $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_calendar'; $this->posting_form_title = do_lang_tempcode('EVENT_TEXT'); require_lang('calendar'); require_lang('dates'); require_css('calendar'); require_code('calendar2'); // Decide what to do if ($type == 'misc') { return $this->misc(); } // Decide what to do if ($type == 'import') { return $this->import_ical(); } if ($type == '_import_ical') { return $this->_import_ical(); } if ($type == 'export') { return $this->export_ical(); } if ($type == '_export') { return $this->_export_ical(); } return new ocp_tempcode(); }
/** * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format. * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive. * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required. * * @return array Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data). */ function tpl_preview__ocf_edit_avatar_tab() { require_lang('ocf'); require_css('ocf'); $avatar = do_lorem_template('OCF_TOPIC_POST_AVATAR', array('AVATAR' => placeholder_image_url())); return array(lorem_globalise(do_lorem_template('OCF_EDIT_AVATAR_TAB', array('USERNAME' => lorem_word(), 'AVATAR' => $avatar, 'WIDTH' => placeholder_number(), 'HEIGHT' => placeholder_number())), NULL, '', true)); }
/** * Standard code module initialisation function. */ function init__svg() { require_css('svg'); // Some default values define('VIEWPORT_WIDTH', 1024.0); define('VIEWPORT_HEIGHT', 400.0); define('SVG_WIDTH', 1024.0); define('SVG_HEIGHT', 400.0); define('Y_LABEL_WIDTH', 50.0); define('Y_AXIS_WIDTH', 50.0); define('PLOT_WIDTH_BIAS', 10.0); define('PLOT_WIDTH', SVG_WIDTH - Y_LABEL_WIDTH - Y_AXIS_WIDTH - PLOT_WIDTH_BIAS); define('X_LABEL_HEIGHT', 13.0); define('X_AXIS_HEIGHT', 13.0); define('PLOT_HEIGHT_BIAS', 10.0); define('PLOT_HEIGHT', SVG_HEIGHT - X_LABEL_HEIGHT - X_AXIS_HEIGHT - PLOT_HEIGHT_BIAS); define('X_PADDING', 2.0); define('Y_PADDING', 2.0); define('MIN_Y_MARKER_DISTANCE', 14.0); define('MIN_X_MARKER_DISTANCE', 14.0); define('TEXT_HEIGHT', 14.0); define('BAR_WIDTH', 15.0); global $CSS_FILE_CONTENTS; $CSS_FILE_CONTENTS = ''; }
/** * Standard aed_module run_start. * * @param ID_TEXT The type of module execution * @return tempcode The output of the run */ function run_start($type) { $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/forums'; $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_forums'; $this->add_one_label = do_lang_tempcode('ADD_FORUM'); $this->edit_this_label = do_lang_tempcode('EDIT_THIS_FORUM'); $this->edit_one_label = do_lang_tempcode('EDIT_FORUM'); global $C_TITLE; $C_TITLE = NULL; if (get_forum_type() != 'ocf') { warn_exit(do_lang_tempcode('NO_OCF')); } else { ocf_require_all_forum_stuff(); } require_code('ocf_forums_action'); require_code('ocf_forums_action2'); require_code('ocf_forums2'); require_css('ocf'); load_up_all_module_category_permissions($GLOBALS['FORUM_DRIVER']->get_guest_id(), 'forums'); if ($type == 'misc') { return $this->misc(); } if ($type == 'reorder') { return $this->reorder(); } return new ocp_tempcode(); }
/** * Get ready for displaying the skin. * * This may register some CSS or JS... */ function display_init() { // call parent: parent::display_init(); // Add CSS: // fp> Note: having those here should allow // 1) Requesting them earlier as if they are @import'ed // 2) Allow bundling // fp> I am not 100% sure though. Comments welcome :) /*require_css( 'basic_styles.css', 'blog' ); // the REAL basic styles require_css( 'basic.css', 'blog' ); // Basic styles require_css( 'blog_base.css', 'blog' ); // Default styles for the blog navigation require_css( 'item_base.css', 'blog' ); // Default styles for the post CONTENT require_css( 'item.css', 'relative' ); require_css( 'style.css', 'relative' );*/ // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images: if ($this->get_setting('colorbox')) { require_js_helper('colorbox', 'blog'); } require_css('basic_styles.css', 'blog'); // the REAL basic styles require_css('basic.css', 'blog'); // Basic styles require_css('style.css', 'relative'); require_js('js/core.js', 'relative'); require_js('navigation.js', 'blog'); }
/** * Standard modular run function. * * @param array A map of parameters. * @return tempcode The result of execution. */ function run($map) { unset($map); if (get_forum_type() != 'ocf') { return new ocp_tempcode(); } if (is_guest()) { return new ocp_tempcode(); } require_css('side_blocks'); ocf_require_all_forum_stuff(); require_code('ocf_notifications'); // Only show what's new in week. Some forums may want to tweak this, but forums themselves only mark unread topics for a week. $rows = ocf_get_pp_rows(); // if (count($rows)==0) return new ocp_tempcode(); require_lang('ocf'); $out = new ocp_tempcode(); foreach ($rows as $topic) { $topic_url = build_url(array('page' => 'topicview', 'id' => $topic['id'], 'type' => 'findpost'), get_module_zone('topicview')); $topic_url->attach('#post_' . strval($topic['id'])); $title = $topic['t_cache_first_title']; $date = get_timezoned_date($topic['t_cache_last_time'], true); $username = $topic['t_cache_last_username']; $member_link = $GLOBALS['OCF_DRIVER']->member_profile_url($topic['t_cache_last_member_id'], false, true); $num_posts = $topic['t_cache_num_posts']; $out->attach(do_template('TOPIC_LIST', array('_GUID' => '55ae21a9f8d67ba6237c118a18b9657b', 'USER_LINK' => $member_link, 'TOPIC_LINK' => $topic_url, 'TITLE' => $title, 'DATE' => $date, 'DATE_RAW' => strval($topic['t_cache_last_time']), 'USERNAME' => $username, 'NUM_POSTS' => integer_format($num_posts)))); } $send_url = build_url(array('page' => 'topics', 'type' => 'new_pt', 'redirect' => SELF_REDIRECT), get_module_zone('topics')); if (!ocf_may_make_personal_topic()) { $send_url = new ocp_tempcode(); } $view_url = build_url(array('page' => 'members', 'type' => 'view', 'id' => get_member()), get_module_zone('members'), NULL, true, false, false, 'tab__pts'); return do_template('BLOCK_SIDE_OCF_PERSONAL_TOPICS', array('_GUID' => '9376cd47884a78f3d1914c176b67ee28', 'SEND_URL' => $send_url, 'VIEW_URL' => $view_url, 'CONTENT' => $out, 'FORUM_NAME' => do_lang_tempcode('PERSONAL_TOPICS'))); }
/** * Standard code module initialisation function. */ function init__ocworld() { require_css('ocworld'); require_lang('ocworld'); require_code('points'); require_lang('permissions'); }
/** * Standard modular run function. * * @return tempcode The result of execution. */ function run() { require_lang('bookmarks'); require_code('bookmarks'); require_css('bookmarks'); if (is_guest()) { access_denied('NOT_AS_GUEST'); } // Decide what we're doing $type = get_param('type', 'misc'); if ($type == 'misc') { return $this->manage_bookmarks(); } if ($type == '_manage') { return $this->_manage_bookmarks(); } if ($type == '_edit') { return $this->_edit_bookmark(); } if ($type == 'ad') { return $this->ad(); } if ($type == '_ad') { return $this->_ad(); } return new ocp_tempcode(); }
/** * Get ready for displaying the skin. * * This may register some CSS or JS... */ function display_init() { // call parent: parent::display_init(); // Add CSS: require_css('basic_styles.css', 'blog'); // the REAL basic styles require_css('basic.css', 'blog'); // Basic styles require_css('blog_base.css', 'blog'); // Default styles for the blog navigation require_css('item_base.css', 'blog'); // Default styles for the post CONTENT // Make sure standard CSS is called ahead of custom CSS generated below: require_css('style.css', 'relative'); require_js('ajax.js', 'blog'); require_js('functions.js'); require_js('rollovers.js'); skin_content_header(); // Sets charset! require_js('jquery-1.2.3.min.js'); require_js('jquery.easing.min.js'); require_js('jquery.lavalamp.min.js'); // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images: if ($this->get_setting("colorbox")) { require_js_helper('colorbox', 'blog'); } }
/** * This function should init the templates - like adding Javascript through the {@link add_headline()} method. */ function init_templates() { global $Hit; // This is included before controller specifc require_css() calls: require_css('basic_styles.css', 'rsc_url'); // the REAL basic styles require_css('basic.css', 'rsc_url'); // Basic styles require_css('results.css', 'rsc_url'); // Results/tables styles require_css('item_base.css', 'rsc_url'); // Default styles for the post CONTENT require_css('fileman.css', 'rsc_url'); // Filemanager styles require_css('admin.global.css', 'rsc_url'); // Basic admin styles require_css('skins_adm/chicago/rsc/css/chicago.css', true); if ($Hit->is_IE()) { require_css('admin_global_ie.css', 'rsc_url'); } // CSS for IE9 add_headline('<!--[if IE 9 ]>'); require_css('ie9.css', 'rsc_url'); add_headline('<![endif]-->'); require_js('#jquery#', 'rsc_url'); require_js('jquery/jquery.raty.min.js', 'rsc_url'); }
/** * Get ready for displaying the skin. * * This may register some CSS or JS... */ function display_init() { // call parent: parent::display_init(); // Add CSS: require_css('basic_styles.css', 'blog'); // the REAL basic styles require_css('basic.css', 'blog'); // Basic styles require_css('blog_base.css', 'blog'); // Default styles for the blog navigation require_css('item_base.css', 'blog'); // Default styles for the post CONTENT require_css('rsc/css/item.css', 'relative'); require_css('rsc/css/style.css', 'relative'); // Add custom CSS: $custom_css = ''; $html5support = ''; if ($this->get_setting('html5_support') == '1') { // HTML5 Support $html5support .= ' <!--[if IE]> <script src="rsc/js/html5.js"></script> <![endif]--> <link rel="stylesheet" href="rsc/css/html5.css" type="text/css" /> '; } $custom_css = '' . $html5support . "\n"; add_headline($custom_css); // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images: if ($this->get_setting("colorbox")) { require_js_helper('colorbox', 'blog'); } }
/** * Standard modular run function. * * @param array A map of parameters. * @return tempcode The result of execution. */ function run($map) { require_code('catalogues'); require_lang('catalogues'); require_css('catalogues'); $number = array_key_exists('param', $map) ? intval($map['param']) : 10; $catalogue = array_key_exists('catalogue', $map) ? $map['catalogue'] : 'faqs'; $zone = array_key_exists('zone', $map) ? $map['zone'] : get_module_zone('catalogues'); $root = array_key_exists('root', $map) && $map['root'] != '' ? intval($map['root']) : NULL; $catalogues = $GLOBALS['SITE_DB']->query_select('catalogues', array('*'), array('c_name' => $catalogue), '', 1); if (!array_key_exists(0, $catalogues)) { return do_lang_tempcode('MISSING_RESOURCE', escape_html($catalogue)); } $catalogue_row = $catalogues[0]; $entries = $GLOBALS['SITE_DB']->query_select('catalogue_entries', array('*'), array('c_name' => $catalogue, 'ce_validated' => 1), 'ORDER BY ce_add_date DESC', $number); $tpl_set = $catalogue; $display_type = array_key_exists('display_type', $map) ? intval($map['display_type']) : NULL; list($content, , ) = get_catalogue_category_entry_buildup(db_get_first_id(), $catalogue, $catalogue_row, 'SEARCH', $tpl_set, $number, 0, NULL, $root, $display_type, false, $entries); $catalogue_title = get_translated_text($catalogue_row['c_title']); if ($content->is_empty()) { if (has_actual_page_access(NULL, 'cms_catalogues', NULL, NULL) && has_submit_permission('mid', get_member(), get_ip_address(), 'cms_catalogues')) { $submit_url = build_url(array('page' => 'cms_catalogues', 'type' => 'add_entry', 'catalogue_name' => $catalogue, 'redirect' => SELF_REDIRECT), get_module_zone('cms_catalogues')); } else { $submit_url = new ocp_tempcode(); } return do_template('BLOCK_NO_ENTRIES', array('HIGH' => false, 'TITLE' => do_lang_tempcode('RECENT', escape_html(integer_format($number)), escape_html($catalogue_title)), 'MESSAGE' => do_lang_tempcode('NO_ENTRIES'), 'ADD_NAME' => do_lang_tempcode('CATALOGUE_GENERIC_ADD', escape_html($catalogue_title)), 'SUBMIT_URL' => $submit_url)); } return do_template('BLOCK_MAIN_RECENT_CC_ENTRIES', array('_GUID' => 'a57fa1b83d1b6fe3acbceb2b618e6d7f', 'CATALOGUE_TITLE' => $catalogue_title, 'CATALOGUE' => $catalogue, 'CONTENT' => $content, 'NUMBER' => integer_format($number))); }
/** * Standard modular run function for award hooks. Renders a content box for an award/randomisation. * * @param array The database row for the content * @param ID_TEXT The zone to display in * @return tempcode Results */ function run($row, $zone) { $url = build_url(array('page' => 'news', 'type' => 'view', 'id' => $row['id']), $zone); $title = get_translated_tempcode($row['title']); $title_plain = get_translated_text($row['title']); $news_cat_rows = $GLOBALS['SITE_DB']->query_select('news_categories', array('nc_title', 'nc_img'), array('id' => $row['news_category']), '', 1); if (!array_key_exists(0, $news_cat_rows)) { warn_exit(do_lang_tempcode('MISSING_RESOURCE')); } $news_cat_row = $news_cat_rows[0]; $category = get_translated_text($news_cat_row['nc_title']); $img = find_theme_image($news_cat_row['nc_img']); if ($row['news_image'] != '') { $img = $row['news_image']; if (url_is_local($img)) { $img = get_base_url() . '/' . $img; } } $news = get_translated_tempcode($row['news']); if ($news->is_empty()) { $news = get_translated_tempcode($row['news_article']); $truncate = true; } else { $truncate = false; } $author_url = addon_installed('authors') ? build_url(array('page' => 'authors', 'type' => 'misc', 'id' => $row['author']), get_module_zone('authors')) : new ocp_tempcode(); $author = $row['author']; require_css('news'); $seo_bits = seo_meta_get_for('news', strval($row['id'])); $map = array('_GUID' => 'jd89f893jlkj9832gr3uyg2u', 'TAGS' => get_loaded_tags('news', explode(',', $seo_bits[0])), 'TRUNCATE' => $truncate, 'AUTHOR' => $author, 'BLOG' => false, 'AUTHOR_URL' => $author_url, 'CATEGORY' => $category, 'IMG' => $img, 'NEWS' => $news, 'ID' => strval($row['id']), 'SUBMITTER' => strval($row['submitter']), 'DATE' => get_timezoned_date($row['date_and_time']), 'DATE_RAW' => strval($row['date_and_time']), 'FULL_URL' => $url, 'NEWS_TITLE' => $title, 'NEWS_TITLE_PLAIN' => $title_plain); if (get_option('is_on_comments') == '1' && !has_no_forum() && $row['allow_comments'] >= 1) { $map['COMMENT_COUNT'] = '1'; } return put_in_standard_box(do_template('NEWS_PIECE_SUMMARY', $map)); }
/** * Standard modular run function. * * @return tempcode The result of execution. */ function run() { require_lang('leader_board'); require_code('points'); require_css('points'); $title = get_page_title('POINT_LEADERBOARD'); $start_date = intval(get_option('leaderboard_start_date')); $weeks = $GLOBALS['SITE_DB']->query('SELECT DISTINCT date_and_time FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'leader_board WHERE date_and_time>=' . strval($start_date) . ' ORDER BY date_and_time DESC'); if (count($weeks) == 0) { warn_exit(do_lang_tempcode('NO_ENTRIES')); } $first_week = $weeks[count($weeks) - 1]['date_and_time']; $weeks = collapse_1d_complexity('date_and_time', $weeks); $out = new ocp_tempcode(); foreach ($weeks as $week) { $rows = collapse_2d_complexity('lb_member', 'lb_points', $GLOBALS['SITE_DB']->query_select('leader_board', array('lb_member', 'lb_points'), array('date_and_time' => $week))); $week_tpl = new ocp_tempcode(); foreach ($rows as $member => $points) { $points_url = build_url(array('page' => 'points', 'type' => 'member', 'id' => $member), get_module_zone('points')); $profile_url = $GLOBALS['FORUM_DRIVER']->member_profile_url($member, false, true); $name = $GLOBALS['FORUM_DRIVER']->get_username($member); if (is_null($name)) { $name = do_lang('UNKNOWN'); } $week_tpl->attach(do_template('POINTS_LEADERBOARD_ROW', array('_GUID' => '6d323b4b5abea0e82a14cb4745c4af4f', 'POINTS_URL' => $points_url, 'PROFILE_URL' => $profile_url, 'POINTS' => integer_format($points), 'NAME' => $name, 'ID' => strval($member)))); } $nice_week = intval(($week - $first_week) / (7 * 24 * 60 * 60) + 1); $out->attach(do_template('POINTS_LEADERBOARD_WEEK', array('_GUID' => '3a0f71bf20f9098e5711e85cf25f6549', 'WEEK' => integer_format($nice_week), 'ROWS' => $week_tpl))); } return do_template('POINTS_LEADERBOARD_SCREEN', array('_GUID' => 'bab5f7b661435b83800532d3eebd0d54', 'TITLE' => $title, 'WEEKS' => $out)); }
/** * Get ready for displaying the skin. * * This may register some CSS or JS... */ function display_init() { // Request some common features that the parent function (Skin::display_init()) knows how to provide: parent::display_init(array('b2evo_base_css', 'colorbox', 'disp_auto')); // require_css( 'style.css', 'relative' ); // require_css( 'item.css', 'relative' ); // require_css( 'evopress.bundle.css', 'relative' ); // Concatenation of the above require_css('evopress.bmin.css', 'relative'); // Concatenation + Minifaction of the above // Add custom CSS: $custom_css = ''; $head_bg_color_top = $this->get_setting('head_bg_color_top'); $head_bg_color_bottom = $this->get_setting('head_bg_color_bottom'); if (!empty($head_bg_color_top) && !empty($head_bg_color_bottom)) { // Custom Header background color: $custom_css .= '#headerimg {' . "\n" . 'background: linear-gradient( to bottom, ' . $head_bg_color_top . ', ' . $head_bg_color_bottom . ');' . "\n" . '}' . "\n"; } if (!empty($custom_css)) { $custom_css = '<style type="text/css"> <!-- ' . $custom_css . ' --> </style>'; add_headline($custom_css); } }
/** * Standard modular run function. * * @param array A map of parameters. * @return tempcode The result of execution. */ function run($map) { require_code('downloads'); require_css('downloads'); require_lang('downloads'); require_code('ocfiltering'); $number = array_key_exists('param', $map) ? intval($map['param']) : 10; $filter = array_key_exists('filter', $map) ? $map['filter'] : '*'; $zone = array_key_exists('zone', $map) ? $map['zone'] : get_module_zone('downloads'); $sql_filter = ocfilter_to_sqlfragment($filter, 'p.category_id', 'download_categories', 'parent_id', 'p.category_id', 'id'); // Note that the parameters are fiddled here so that category-set and record-set are the same, yet SQL is returned to deal in an entirely different record-set (entries' record-set) $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . get_table_prefix() . 'download_downloads p WHERE validated=1 AND (' . $sql_filter . ') ORDER BY add_date DESC', $number); $title = do_lang_tempcode('RECENT', make_string_tempcode(integer_format($number)), do_lang_tempcode('SECTION_DOWNLOADS')); if (array_key_exists('title', $map) && $map['title'] != '') { $title = protect_from_escaping(escape_html($map['title'])); } $out = new ocp_tempcode(); foreach ($rows as $i => $row) { if ($i != 0) { $out->attach(do_template('BLOCK_SEPARATOR')); } $out->attach(get_download_html($row, true, true, $zone)); } if ($out->is_empty()) { if (has_actual_page_access(NULL, 'cms_downloads', NULL, NULL) && has_submit_permission('mid', get_member(), get_ip_address(), 'cms_downloads')) { $submit_url = build_url(array('page' => 'cms_downloads', 'type' => 'ad', 'redirect' => SELF_REDIRECT), get_module_zone('cms_downloads')); } else { $submit_url = new ocp_tempcode(); } return do_template('BLOCK_NO_ENTRIES', array('_GUID' => '74399763a51102bdd6e6d92c2c11354f', 'HIGH' => false, 'TITLE' => $title, 'MESSAGE' => do_lang_tempcode('NO_DOWNLOADS_YET'), 'ADD_NAME' => do_lang_tempcode('ADD_DOWNLOAD'), 'SUBMIT_URL' => $submit_url)); } return do_template('BLOCK_MAIN_RECENT_DOWNLOADS', array('_GUID' => '257fa1b83d1b6fe3acbceb2b618e6d7f', 'TITLE' => $title, 'CONTENT' => $out, 'NUMBER' => integer_format($number))); }
/** * Standard modular run function. * * @param array A map of parameters. * @return tempcode The result of execution. */ function run($map) { require_lang('galleries'); require_code('galleries'); require_css('galleries'); require_css('side_blocks'); $parent_id = array_key_exists('param', $map) ? $map['param'] : 'root'; $zone = array_key_exists('zone', $map) ? $map['zone'] : get_module_zone('galleries'); $show_empty = array_key_exists('show_empty', $map) ? $map['show_empty'] == '1' : false; $depth = array_key_exists('depth', $map) ? intval($map['depth']) : 0; // If depth is 1 then we go down 1 level. Only 0 or 1 is supported. // For all galleries off the root gallery $query = 'SELECT name,fullname FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'galleries WHERE ' . db_string_equal_to('parent_id', $parent_id) . ' AND name NOT LIKE \'' . db_encode_like('download\\_%') . '\' ORDER BY add_date'; $galleries = $GLOBALS['SITE_DB']->query($query, 300); if ($depth == 0) { $content = $this->inside($zone, $galleries, 'BLOCK_SIDE_ROOT_GALLERIES_LINE', $show_empty); } else { $content = new ocp_tempcode(); foreach ($galleries as $gallery) { if ($show_empty || gallery_has_content($gallery['name'])) { $subgalleries = $GLOBALS['SITE_DB']->query_select('galleries', array('name', 'fullname'), array('parent_id' => $gallery['name']), 'ORDER BY add_date', 300); $nest = $this->inside($zone, $subgalleries, 'BLOCK_SIDE_ROOT_GALLERIES_LINE_DEPTH', $show_empty); $caption = get_translated_text($gallery['fullname']); $content->attach(do_template('BLOCK_SIDE_ROOT_GALLERIES_LINE_CONTAINER', array('_GUID' => 'e50b84369b5e2146c4fab4fddc84bf0a', 'ID' => $gallery['name'], 'CAPTION' => $caption, 'CONTENTS' => $nest))); } } } $_title = $GLOBALS['SITE_DB']->query_value_null_ok('galleries', 'fullname', array('name' => $parent_id)); if (!is_null($_title)) { $title = get_translated_text($_title); } else { $title = ''; } return do_template('BLOCK_SIDE_ROOT_GALLERIES', array('_GUID' => 'ed420ce9d1b1dde95eb3fd8473090228', 'TITLE' => $title, 'ID' => $parent_id, 'DEPTH' => $depth != 0, 'CONTENT' => $content)); }
/** * Get ready for displaying the skin. * * This may register some CSS or JS... */ function display_init() { // call parent: parent::display_init(); // Add CSS: require_css('basic_styles.css', 'blog'); // the REAL basic styles require_css('basic.css', 'blog'); // Basic styles require_css('blog_base.css', 'blog'); // Default styles for the blog navigation require_css('item_base.css', 'blog'); // Default styles for the post CONTENT // Make sure standard CSS is called ahead of custom CSS generated below: require_css('style.css', true); // Add custom CSS: $custom_css = ''; if ($body_bg_color = $this->get_setting('body_bg_color')) { // Custom Header background color: $custom_css .= ' body { background-color: ' . $body_bg_color . " }\n"; } if (!empty($custom_css)) { $custom_css = '<style type="text/css"> <!-- ' . $custom_css . ' --> </style>'; add_headline($custom_css); } // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images: if ($this->get_setting("colorbox")) { require_js_helper('colorbox', 'blog'); } }
/** * Standard modular render function for profile tab hooks. * * @param MEMBER The ID of the member who is being viewed * @param MEMBER The ID of the member who is doing the viewing * @param boolean Whether to leave the tab contents NULL, if tis hook supports it, so that AJAX can load it later * @return array A triple: The tab title, the tab contents, the suggested tab order */ function render_tab($member_id_of, $member_id_viewing, $leave_to_ajax_if_possible = false) { $title = do_lang_tempcode('MODULE_TRANS_NAME_warnings'); $order = 80; if ($leave_to_ajax_if_possible) { return array($title, NULL, $order); } require_lang('ocf'); require_css('ocf'); $warnings = new ocp_tempcode(); $rows = $GLOBALS['FORUM_DB']->query_select('f_warnings', array('*'), array('w_member_id' => $member_id_of, 'w_is_warning' => 1)); foreach ($rows as $row) { $warning_by = $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['w_by']); $date = get_timezoned_date($row['w_time']); if ($row['w_explanation'] == '') { $row['w_explanation'] = '?'; } else { $row['w_explanation'] = str_replace(chr(10), ' ', $row['w_explanation']); } $row['w_explanation_orig'] = $row['w_explanation']; if (strlen($row['w_explanation']) > 30) { $row['w_explanation'] = substr($row['w_explanation'], 0, 27) . '...'; } $explanation = hyperlink(build_url(array('page' => 'warnings', 'type' => '_ed', 'id' => $row['id'], 'redirect' => get_self_url(true)), get_module_zone('warnings')), $row['w_explanation'], false, true, $row['w_explanation_orig']); $warnings->attach(paragraph(do_lang_tempcode('MEMBER_WARNING', $explanation, $warning_by, array(make_string_tempcode(escape_html($date)))), 'treyerhy34y')); } $content = do_template('OCF_MEMBER_PROFILE_WARNINGS', array('MEMBER_ID' => strval($member_id_of), 'WARNINGS' => $warnings)); return array($title, $content, $order); }
/** * Standard modular run function for search results. * * @param string Search string * @param boolean Whether to only do a META (tags) search * @param ID_TEXT Order direction * @param integer Start position in total results * @param integer Maximum results to return in total * @param boolean Whether only to search titles (as opposed to both titles and content) * @param string Where clause that selects the content according to the main search string (SQL query fragment) (blank: full-text search) * @param SHORT_TEXT Username/Author to match for * @param ?MEMBER Member-ID to match for (NULL: unknown) * @param TIME Cutoff date * @param string The sort type (gets remapped to a field in this function) * @set title add_date * @param integer Limit to this number of results * @param string What kind of boolean search to do * @set or and * @param string Where constraints known by the main search code (SQL query fragment) * @param string Comma-separated list of categories to search under * @param boolean Whether it is a boolean search * @return array List of maps (template, orderer) */ function run($content, $only_search_meta, $direction, $max, $start, $only_titles, $content_where, $author, $author_id, $cutoff, $sort, $limit_to, $boolean_operator, $where_clause, $search_under, $boolean_search) { unset($limit_to); if (get_forum_type() != 'ocf') { return array(); } if (get_member() == $GLOBALS['OCF_DRIVER']->get_guest_id()) { return array(); } require_code('ocf_forums'); require_code('ocf_posts'); require_css('ocf'); $remapped_orderer = ''; switch ($sort) { case 'title': $remapped_orderer = 'p_title'; break; case 'add_date': $remapped_orderer = 'p_time'; break; } require_lang('ocf'); // Calculate our where clause (search) $where_clause .= ' AND '; $where_clause .= 't_forum_id IS NULL AND (t_pt_from=' . strval((int) get_member()) . ' OR t_pt_to=' . strval((int) get_member()) . ')'; $sq = build_search_submitter_clauses('p_poster', $author_id, $author); if (is_null($sq)) { return array(); } else { $where_clause .= $sq; } if (!is_null($cutoff)) { $where_clause .= ' AND '; $where_clause .= 'p_time>' . strval($cutoff); } if (get_param_integer('option_ocf_posts_starter', 0) == 1) { $where_clause .= ' AND '; $where_clause .= 's.t_cache_first_post_id=r.id'; } if (!has_specific_permission(get_member(), 'see_unvalidated')) { $where_clause .= ' AND '; $where_clause .= 'p_validated=1'; } // Calculate and perform query $rows = get_search_rows(NULL, NULL, $content, $boolean_search, $boolean_operator, $only_search_meta, $direction, $max, $start, $only_titles, 'f_posts r LEFT JOIN ' . get_table_prefix() . 'f_topics s ON r.p_topic_id=s.id', array('!', 'r.p_post'), $where_clause, $content_where, $remapped_orderer, 'r.*', array('r.p_title')); $out = array(); foreach ($rows as $i => $row) { $out[$i]['data'] = $row; unset($rows[$i]); if ($remapped_orderer != '' && array_key_exists($remapped_orderer, $row)) { $out[$i]['orderer'] = $row[$remapped_orderer]; } elseif (substr($remapped_orderer, 0, 7) == '_rating') { $out[$i]['orderer'] = $row['compound_rating']; } } return $out; }