Example #1
1
                    <?php 
} else {
    ?>
					<li class="home_item"><a href="<?php 
    bloginfo('url');
    ?>
">Home</a></li>
                    <?php 
}
?>
		    <?php 
$companies_id = get_page_id('Companies');
$corpnews_id = get_page_id('Corporate News');
$service_id = get_page_id('Service Provider Directory');
$contact_id = get_page_id('Contact Us');
$ad_id = get_page_id('Advertise');
?>
			<?php 
wp_list_pages('title_li=&sort_column=menu_order&exclude=' . $contact_id . ',' . $ad_id . ',' . $companies_id . ',' . $corpnews_id . ',' . $service_id);
?>
				<li><a href="mailto:suggest@e27.sg">Tip Us</a></li>
                </ul>
                <!-- END OF MENU -->
                <form method="get" id="searchform" action="<?php 
bloginfo('url');
?>
/">
            	<div class="SearchBox">
                	<input type="text" value="<?php 
the_search_query();
?>
function get_edition_data($edition_num, $is_package)
{
    $pages = array();
    $num_pages = get_number_of_pages($edition_num);
    for ($page_num = 1; $page_num <= $num_pages; $page_num++) {
        $pages[] = get_page_id($edition_num, $page_num);
    }
    $cycle = $edition_num % 10 + 1;
    $edition_date = add_date(time(), $edition_num);
    return array('key' => get_edition_id($edition_num), 'date' => $edition_date, 'title' => "Edition Number {$edition_num}", 'modified' => time(), 'packaged' => time(), 'status' => 'published', 'price' => 'FREE', 'thumbnail' => "http://lorempixel.com/600/800/abstract/{$cycle}/Issue-{$edition_num}-{$edition_date}/", 'newsstand_cover_art_icon_source' => "http://dummyimage.com/768x1024/000000/ffffff.png?text=Newstand+Cover+768x1024+Issue+{$edition_num}/", 'summary' => "Summary Number {$edition_num}", 'tombstone' => FALSE, 'url_type' => $is_package ? 'application/pugpigpkg+xml' : 'application/atom+xml', 'url' => "edition/{$edition_num}/" . ($is_package ? 'package.xml' : 'content.xml'), 'newsstand_summary' => "Newsstand sumamry number {$edition_num}", 'page_ids' => $pages);
}
Example #3
0
function show_login_form($HTTP_VARS, $errors = NULL)
{
    global $PHP_SELF;
    echo _theme_header(get_opendb_lang_var('login'), is_show_login_menu_enabled());
    echo "<h2>" . get_opendb_lang_var('login') . "</h2>";
    if (is_not_empty_array($errors)) {
        echo format_error_block($errors);
    }
    echo "<div id=\"loginFormDiv\">";
    if ($HTTP_VARS['rememberMeLogin'] == 'true') {
        echo "<p class=\"rememberMeLoginMessage\">" . get_opendb_lang_var('not_authorized_to_page_login') . "</p>";
    }
    if (strlen($HTTP_VARS['redirect']) > 0) {
        echo "<p class=\"redirectMessage\">" . get_opendb_lang_var('login_redirect_message', array('pageid' => get_page_id($HTTP_VARS['redirect']))) . "</p>";
    }
    echo "<form id=\"loginForm\" action=\"{$PHP_SELF}\" method=\"POST\" name=\"login\">";
    // The user tried to go straight to a menu item with an invalid session.
    // Set a "redirect" variable here so that after we give them a full session
    // we can redirect them back to the page they really wanted.
    if (strlen($HTTP_VARS['redirect']) > 0) {
        echo "<input type=\"hidden\" name=\"redirect\" value=\"" . $HTTP_VARS['redirect'] . "\">";
    }
    echo "<input type=\"hidden\" name=\"op\" value=\"login\">";
    echo "\n<ul>" . "\n<li><label class=\"label\" for=\"uid\">" . get_opendb_lang_var('userid') . "</label>" . "<input type=\"text\" class=\"text\" id=\"uid\" name=\"uid\" value=\"" . $HTTP_VARS['uid'] . "\"></li>" . "\n<li><label class=\"label\" for=\"password\">" . get_opendb_lang_var('password') . "</label>" . "<input type=\"password\" class=\"password\" id=\"passwd\" name=\"passwd\"></li>";
    echo "\n<li><label class=\"label\" for=\"remember\">" . get_opendb_lang_var('remember_me') . "</label>" . "<input type=\"checkbox\" class=\"remember\" id=\"remember\" name=\"remember\" value=\"true\"></li>";
    echo "</ul>" . "\n<input type=\"submit\" class=\"submit\" value=\"" . get_opendb_lang_var('login') . "\">";
    echo "</form>";
    // force uid field focus for login
    echo "\n<script type=\"text/javascript\">\n\t\tdocument.forms['login']['uid'].focus();\n\t</script>";
    if (is_site_enabled() && is_valid_opendb_mailer()) {
        if (strlen($HTTP_VARS['uid']) > 0 && get_opendb_config_var('login', 'enable_new_pwd_gen') !== FALSE && is_user_granted_permission(PERM_CHANGE_PASSWORD, $HTTP_VARS['uid'])) {
            $footer_links_r[] = array(url => $PHP_SELF . "?op=newpassword&uid=" . urlencode($HTTP_VARS['uid']), text => get_opendb_lang_var('forgot_your_pwd'));
        }
        // no point if site disabled, email is not available
        if (get_opendb_config_var('email', 'send_to_site_admin') !== FALSE) {
            $footer_links_r[] = array(text => get_opendb_lang_var('email_administrator'), target => "popup(640,480)", url => "email.php?op=send_to_site_admin&inc_menu=N");
        }
    }
    // Indicate we should show the signup link.
    if (get_opendb_config_var('login.signup', 'enable') !== FALSE) {
        $footer_links_r[] = array(url => "user_admin.php?op=signup", text => get_opendb_lang_var('sign_me_up'));
    }
    echo format_footer_links($footer_links_r);
    echo "</div>";
    echo _theme_footer();
}
 function show_blocks($page, $position)
 {
     global $k_config;
     $page_id = get_page_id($page);
     if ($position == 'L') {
         //return($k_config['show_lb_ipsmuy'][$page_id]) ? true : false;
         return true;
     } else {
         if ($position == 'R') {
             //return($k_config['show_rb_ipsmuy'][$page_id]) ? true : false;
             return true;
         } else {
             if ($position == 'C') {
                 //return($k_config['show_rb_ipsmuy'][$page_id]) ? true : false;
                 return true;
             }
         }
     }
 }
Example #5
0
        <?php 
get_template_part('includes/slider');
?>


        <?php 
if (isset($woo_options['woo_homepage_content']) && $woo_options['woo_homepage_content'] != 'Disabled') {
    ?>

            <div class="home-content">
                <?php 
    if ($woo_options['woo_homepage_content'] == "Show latest blog post") {
        query_posts('showposts=1');
    } else {
        query_posts('page_id=' . get_page_id($woo_options['woo_homepage_content']));
    }
    ?>

                <?php 
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            ?>
		        					
                        <h2 class="title"><?php 
            the_title();
            ?>
</h2>
                        <div class="entry">
                            <?php 
Example #6
0
    }
    ?>
	
	            <div class="fix"></div>
	        </div><!-- /#mini-features -->
	        <?php 
}
?>
	

	        <?php 
if ($woo_options['woo_main_page2'] && $woo_options['woo_main_page2'] != "Select a page:" && !is_paged()) {
    ?>
	        <div id="main-page2">
				<?php 
    query_posts('page_id=' . get_page_id($woo_options['woo_main_page2']));
    ?>
	            <?php 
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            ?>
		        					
			    <div class="entry"><?php 
            the_content();
            ?>
</div>
	            <?php 
        }
    }
    ?>
Example #7
0
File: wiki.php Project: GMOD/Chado
function get_wikibox_id($page_name, $template = '', $namespace = 0)
{
    global $wgServerName, $wgDBname, $wgTableEditDatabase;
    $dbr =& wfGetDB(DB_SLAVE);
    $dbr->selectDB($wgTableEditDatabase);
    $page_uid = get_page_id($page_name, $namespace);
    $conditions = array('page_name' => $page_name, 'page_uid' => $page_uid);
    if ($template != '') {
        $conditions['template'] = $template;
    }
    $result = $dbr->selectRow("box", array('box_id'), $conditions);
    $dbr->selectDB($wgDBname);
    if ($result) {
        return $result->box_id;
    }
    $dbw =& wfGetDB(DB_MASTER);
    $dbw->selectDB($wgTableEditDatabase);
    $box_uid = md5($wgServerName) . ".{$page_uid}." . uniqid(chr(rand(65, 90)));
    # box does not exist, need a new one
    $result = $dbw->insert("box", array('template' => $template, 'page_name' => $page_name, 'page_uid' => $page_uid, 'box_uid' => $box_uid, 'timestamp' => time()));
    $dbw->selectDB($wgDBname);
    return $dbw->insertId();
}
 function get_edition_data($edition_num, $is_package)
 {
     $num_editions = get_number_of_editions();
     $edition_key = get_edition_id($edition_num);
     $edition_date = add_date(time(), $edition_num);
     $modified = add_date_timestamp(time(), $edition_num);
     $cycle = $edition_num % 10 + 1;
     // http response
     $http_responses = array(200, 404, 401, 403, 500);
     $http_reponses_index = $num_editions - 10 - $edition_num;
     $http_status = 0;
     if ($http_reponses_index >= 0 && $http_reponses_index < count($http_responses)) {
         $http_status = $http_responses[$http_reponses_index];
     }
     $is_timeout = $http_reponses_index == count($http_responses);
     $is_broken = $is_timeout || $http_status > 0;
     // edition flags
     $is_published = $edition_num % 3;
     $is_paid = !$is_broken && $edition_num % 7;
     $is_vampire = $edition_num == $num_editions - 20;
     $is_deleted = $is_vampire && rand(0, 1) == 1;
     // strings
     $price = $is_paid ? 'PAID' : 'FREE';
     $status = $is_published ? 'published' : 'draft';
     // url
     if ($http_status == 0) {
         if ($is_timeout) {
             $url = '../auth_test/responses/timeout.php';
         } else {
             $query = empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING'];
             $url = "edition/{$edition_num}/" . ($is_package ? 'package.xml' : 'content.xml') . $query;
         }
     } else {
         $url = "../auth_test/responses/{$http_status}.php";
         // todo: fix relative path, so we can find authtest from custom content
     }
     $http_status_summary = array(200 => 'All lies. I return a fake 200 code.', 404 => 'Not Found. I return a 404 code.', 401 => 'Unauthorized. I return a 401 code.', 403 => 'Forbidden. I return a 403 code.', 500 => 'Broken. I return a 500 code.');
     // summary
     $always_updates = $edition_num % 9 == 0;
     $long_ttl = $edition_num % 27 == 0;
     $summary = "You really should read edition {$edition_num}. It's the best {$status} ever. ";
     if ($is_published) {
         $summary .= "It is {$price}. ";
     } else {
         $summary .= "All draft editions are treated as free. ";
     }
     if ($always_updates) {
         $summary .= "And it ALWAYS updates. ";
     }
     if ($long_ttl) {
         $summary .= "I have a long 5 minute TTL on the Atom and Package feeds. ";
     }
     if ($is_vampire) {
         $summary .= "I get deleted and then raise from the dead. ";
     }
     if ($http_status > 0) {
         $summary = $http_status_summary[$http_status] . ' ' . $summary;
     }
     if ($is_timeout) {
         $summary = 'Timeout. I take 60 seconds.' . ' ' . $summary;
     }
     // pages
     $pages = array();
     $num_pages = get_number_of_pages($edition_num);
     for ($page_num = 1; $page_num <= $num_pages; $page_num++) {
         $pages[] = get_page_id($edition_num, $page_num);
     }
     return array('key' => $edition_key, 'date' => $edition_date, 'title' => ($is_broken ? 'Broken Test ' : '') . ($is_vampire ? "Vampire " : "") . "Edition Number {$edition_num}", 'modified' => !$always_updates ? $modified : time(), 'packaged' => !$always_updates ? $modified : time(), 'ttl' => $long_ttl ? 300 : 0, 'status' => $status, 'price' => $price, 'thumbnail' => "http://lorempixel.com/600/800/abstract/{$cycle}/Issue-{$edition_num}-{$edition_date}/", 'newsstand_cover_art_icon_source' => "http://dummyimage.com/768x1024/000000/ffffff.png?text=Newstand+Cover+768x1024+Issue+{$edition_num}/", 'summary' => $summary, 'tombstone' => $is_deleted, 'url_type' => $is_package ? 'application/pugpigpkg+xml' : 'application/atom+xml', 'url' => $url, 'newsstand_summary' => 'This is a longer summary that can appear in Newsstand. ' . $summary, 'page_ids' => $pages);
 }
Example #9
0
function show_archives()
{
    global $s, $m, $x, $mtitle, $site_url, $page_display_name, $lang, $timezone;
    $date_array = getdate();
    $this_month = $date_array['mon'];
    $this_year = $date_array['year'];
    if (isset($s)) {
        $id = get_page_id($s);
        $rs = safe_row('*', 'pixie_dynamic_posts', "page_id = '{$id}' and public = 'yes' order by posted asc limit 0,1");
    }
    echo "<div id=\"archives\">\n\t\t\t\t\t\t<h3>{$mtitle}</h3>\n\t\t\t\t\t\t<dl class=\"list_archives\">\n";
    if ($rs) {
        extract($rs);
        $last_year = returnUnixtimestamp($posted);
        $last_year = date('Y', $last_year);
        $num = ($this_year - $last_year) * 12 + 12;
        $i = 0;
        while ($i < $num) {
            $smonth = mktime(0, 0, 0, $this_month, 1, $this_year);
            $start_month = safe_strftime('%Y-%m-%d', $smonth);
            $last_day = date('t', $smonth);
            $emonth = mktime(23, 59, 59, $this_month, $last_day, $this_year);
            $end_month = safe_strftime('%Y-%m-%d %H:%M:%S', $emonth);
            $search = safe_rows('*', 'pixie_dynamic_posts', "page_id = '{$id}' and public = 'yes' and posted between '" . $start_month . "' and date '" . $end_month . "' order by posted desc");
            if ($search) {
                echo "\t\t\t\t\t\t\t<dt>" . date('F', $smonth) . " " . $this_year . "</dt>\n";
                $numy = count($search);
                $j = 0;
                while ($j < $numy) {
                    $out = $search[$j];
                    $title = $out['title'];
                    $posty = $out['posted'];
                    $slug = $out['post_slug'];
                    $stamp = returnUnixtimestamp($posty);
                    $day = date('d', $stamp);
                    echo "\t\t\t\t\t\t\t<dd><span class=\"archive_subdate\">" . $day . ":</span> <a href=\"";
                    if (isset($s)) {
                        echo createURL($s, 'permalink', $slug);
                    }
                    echo "\" title=\"" . $lang['permalink_to'] . ": {$title}\">" . $title . "</a></dd>\n";
                    $j++;
                }
                $this_month = $this_month - 1;
                if ($this_month == 0) {
                    $this_month = 12;
                    $this_year = $this_year - 1;
                }
            } else {
                $this_month = $this_month - 1;
                if ($this_month == 0) {
                    $this_month = 12;
                    $this_year = $this_year - 1;
                }
            }
            $i++;
        }
    }
    echo "\t\t\t\t\t\t</dl>\n\t\t\t\t\t</div>";
}
 function get_page_data($edition_num, $page_num)
 {
     $num_pages = get_number_of_pages($edition_num);
     $custom_categories = array();
     if ($page_num % 7 == 0) {
         $custom_categories['toc_style'] = 'hidden';
     }
     $spectrum_colours = array('black', 'blue', 'red', 'magenta', 'cyan', 'yellow', 'white', null);
     $colour_index = ($edition_num + $page_num) % count($spectrum_colours);
     $colour = $spectrum_colours[$colour_index];
     if ($colour != null) {
         $custom_categories['custom_analytics/col#22'] = $colour;
     }
     $page_data = array('id' => get_page_id($edition_num, $page_num), 'title' => "Page Number {$page_num}", 'categories' => array("Section " . ceil($page_num / ($num_pages / 5))), 'summary' => "Page Number {$page_num} is really interesting", 'status' => 'published', 'url' => "page-{$page_num}.html", 'manifest' => "page-{$page_num}.manifest", 'custom_categories' => $custom_categories);
     if ($page_num % 5 == 0) {
         $page_data['sharing_link'] = 'http://pugpig.com';
     }
     return $page_data;
 }
Example #11
0
    ?>
&amp;wiki=<?php 
    echo $wiki;
    ?>
">
                    Judge
                </a>
            </td>
        </tr>
        <?php 
}
$newer_pageids = [];
if ($all_verdicts) {
    foreach ($all_verdicts as $page_title => $data) {
        if (!isset($page_shown[$page_title])) {
            array_push($newer_pageids, get_page_id($page_title, $wiki));
        }
    }
}
$newer_page_sizes = get_page_size($newer_pageids, $wiki)['query']['pages'];
if (count($newer_page_sizes) > 0) {
    $newer_page_sizes = array();
}
foreach ($newer_page_sizes as $page_id => $data) {
    if (!array_key_exists('revisions', $data)) {
        continue;
    }
    $page_size = $data['revisions'][0]['size'];
    $status = !empty($all_verdicts[$data['title']]) ? $all_verdicts[$data['title']]['verdict'] : "pending";
    $remarks = isset($all_verdicts[$data['title']]) ? $all_verdicts[$data['title']]['remarks'] : "";
    $judged_by = isset($all_verdicts[$data['title']]) ? $all_verdicts[$data['title']]['last_updated_by'] : "";
                 if ($block_view_by == $member['group_id']) {
                     $process_block = true;
                 } else {
                     for ($j = 0; $j < count($grps); $j++) {
                         if ($grps[$j] == $member['group_id']) {
                             $process_block = true;
                         }
                     }
                 }
             }
         }
     } else {
         $process_block = false;
     }
 }
 $page_id = get_page_id($this_page_name);
 if ($process_block && $block_view_by > 0 && in_array($page_id, $arr)) {
     switch ($block_position) {
         case 'L':
             $left_block_ary[$L] = $html_file_name;
             $left_block_id[$L] = $block_id;
             $left_block_ndx[$L] = $block_ndx;
             $left_block_title[$L] = $block_title;
             $left_block_img[$L] = $img_file_name;
             $left_block_scroll[$L] = $block_scroll;
             $left_block_height[$L] = $block_height;
             $L++;
             $show_left = show_blocks($this_page_name, $block_position);
             break;
         case 'C':
             $center_block_ary[$C] = $html_file_name;
Example #13
0
function pixie()
{
    global $s, $m, $x, $p, $rel_path, $staticpage, $style, $site_url, $page_display_name, $page_type, $page_id, $syle, $clean_urls, $default_page;
    $request = $_SERVER['REQUEST_URI'];
    if ($style) {
        $request = str_replace("?style={$style}", "", $request);
    }
    $site_url_last = $site_url[strlen($site_url) - 1];
    if ($site_url_last != '/') {
        $site_url = $site_url . '/';
    }
    if ($clean_urls == 'yes') {
        // if the request contains a ? then this person is accessing with a dirty URL and is handled accordingly
        if (strpos($request, '?s=') !== FALSE) {
            $rel_path = './';
        } else {
            //this is directory level of your installation. check autofind works!?!?
            $url = explode('/', $request);
            $count = count($url);
            $site_url_x = str_replace('http://', "", $site_url);
            $temp = explode('/', $site_url_x);
            $install = count($temp);
            $dir_level = $install - 2;
            if ($dir_level < 0) {
                $dir_level = 0;
            }
            if (isset($url[$dir_level + 1])) {
                $s = strtolower($url[$dir_level + 1]);
            } else {
                $s = NULL;
            }
            if (isset($url[$dir_level + 2])) {
                $m = strtolower($url[$dir_level + 2]);
            } else {
                $m = NULL;
            }
            if (isset($url[$dir_level + 3])) {
                $x = strtolower($url[$dir_level + 3]);
            } else {
                $x = NULL;
            }
            if (isset($url[$dir_level + 4])) {
                $p = strtolower($url[$dir_level + 4]);
            } else {
                $p = NULL;
            }
            switch ($count) {
                case $dir_level + 3:
                    $rel_path = '../';
                    break;
                case $dir_level + 4:
                    $rel_path = '../../';
                    break;
                case $dir_level + 5:
                    $rel_path = '../../../';
                    break;
                case $dir_level + 6:
                    $rel_path = '../../../../';
                    break;
                default:
                    $rel_path = './';
                    break;
            }
        }
    } else {
        $rel_path = './';
    }
    if (!isset($s) or !$s) {
        $last = $default_page[strlen($default_page) - 1];
        $default = explode('/', $default_page);
        if (isset($default['0'])) {
            $s = sterilise_txt($default['0']);
        } else {
            $s = NULL;
        }
        if (isset($default['1'])) {
            $m = sterilise_txt($default['1']);
        } else {
            $m = NULL;
        }
        if (isset($default['2'])) {
            $x = sterilise_txt($default['2']);
        } else {
            $x = NULL;
        }
        if (isset($default['3'])) {
            $p = sterilise_txt($default['3']);
        } else {
            $p = NULL;
        }
    }
    $s = public_check_404($s);
    if (isset($s) && $s == '404') {
        $m = "";
        $x = "";
        $p = "";
    }
    if ($m == 'rss') {
        if (isset($s)) {
            $rss = public_check_rss($s);
        }
        if (!$rss) {
            $s = '404';
            $m = "";
            $x = "";
            $p = "";
        }
    }
    if (isset($s)) {
        $page_type = check_type($s);
    }
    if ($page_type == 'dynamic') {
        $style = $page_type;
    } else {
        if ($page_type == 'static') {
            $style = $s;
            $m = "";
            $x = "";
            $p = "";
        } else {
            if ($s == '404') {
                $style = '404';
            } else {
                $style = $s;
            }
        }
    }
    function resolver($string)
    {
        $string = str_replace('-', 'BREAK', $string);
        $string = preg_replace('/[^a-zA-Z0-9]/', "", $string);
        $string = str_replace('BREAK', '-', $string);
        return $string;
    }
    $s = resolver($s);
    $m = resolver($m);
    $x = resolver($x);
    $p = resolver($p);
    $page_id = get_page_id($s);
    $page_hits = safe_field('page_views', 'pixie_core', "page_name='{$s}'");
    $page_display_name = safe_field('page_display_name', 'pixie_core', "page_name='{$s}'");
    safe_update('pixie_core', "page_views  = {$page_hits} + 1", "page_name = '{$s}'");
}
 * along with this program. If not, see http://www.gnu.org/licenses/
 *
 * Title: Tag Cloud block
 *
 * @package Pixie
 * @copyright 2008-2010 Scott Evans
 * @author Scott Evans
 * @author Sam Collett
 * @author Tony White
 * @author Isa Worcs
 * @link http://www.getpixie.co.uk
 * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3
 *
 */
if (isset($s)) {
    $id = get_page_id($s);
    $type = check_type($s);
    global $lang;
    global $timezone;
    if ($type == 'dynamic') {
        $table = 'pixie_dynamic_posts';
    } else {
        if ($type == 'module') {
            $table = "pixie_module_{$s}";
        }
    }
    echo "\t\t\t\t\t<div id=\"block_tagcloud\" class=\"block\">\n\t\t\t\t\t\t<div class=\"block_header\">\n\t\t\t\t\t\t\t<h4>" . $lang['tags'] . "</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"block_body\">\n";
    if ($type == 'dynamic') {
        public_tag_cloud($table, "page_id = {$id} and public = 'yes'");
    } else {
        $condition = "{$s}_id >= '0'";
Example #15
0
 function ShowBody()
 {
     global $edit, $s, $m, $x, $page, $page_display_name, $lang, $type;
     // check $edit against $x - they need to represent the same page, if not redirect.
     $checkid = safe_field('page_id', 'pixie_core', "page_name='{$x}'");
     if (isset($edit) && $edit && $m == 'static') {
         if ($edit != $checkid) {
             echo "<div class=\"helper\"><h3>" . $lang['help'] . "</h3><p>" . $lang['unknown_edit_url'] . "</p></div>";
             $cancel = TRUE;
         }
     }
     if (isset($cancel)) {
     } else {
         $cancel_not_set = 1;
     }
     if ($cancel_not_set == 1) {
         $Nams = explode('|', substr($this->Nam, 0, strlen($this->Nam) - 1));
         $Type = explode('|', substr($this->Typ, 0, strlen($this->Typ) - 1));
         $Leng = explode('|', substr($this->Len, 0, strlen($this->Len) - 1));
         $Flag = explode('|', substr($this->Flg, 0, strlen($this->Flg) - 1));
         $Fild = explode('|', substr($this->Res, 0, strlen($this->Res) - 1));
         if (!$page) {
             $page = 1;
         }
         if (isset($s) && $s == 'settings') {
             if (strpos($this->tablename, 'module')) {
                 $formtitle = $lang['advanced'] . " " . $lang['page_settings'];
             } else {
                 if (strpos($this->tablename, 'dynamic')) {
                     $formtitle = $lang['advanced'] . " " . $lang['page_settings'];
                 } else {
                     $formtitle = $lang['page_settings'];
                 }
             }
         } else {
             if (isset($edit) && $edit) {
                 if ($m == 'static') {
                     $formtitle = $lang['edit'] . " {$page_display_name} " . $lang['settings_page'];
                 } else {
                     $formtitle = $lang['edit'] . " {$page_display_name} " . str_replace('.', "", $lang['entry']) . " (#{$edit})";
                 }
             } else {
                 $formtitle = $lang['new_entry'] . " {$page_display_name} " . str_replace('.', "", $lang['entry']);
             }
         }
         if (isset($s) && $s == 'settings') {
             $post = "?s={$s}&amp;x={$x}";
         } else {
             if ($m == 'static' && isset($edit)) {
                 $post = "?s={$s}&amp;m={$m}&amp;x={$x}&amp;edit={$edit}&amp;page={$page}";
             } else {
                 $post = "?s={$s}&amp;m={$m}&amp;x={$x}&amp;page={$page}";
             }
         }
         echo "<form accept-charset=\"UTF-8\" action=\"{$post}\" method=\"post\" id=\"form_addedit\" class=\"form\">\n";
         echo "\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>{$formtitle}</legend>\n";
         echo "\t\t\t\t\t\t\t<input type=\"hidden\" class=\"form_text\" name=\"table_name\" value=\"{$this->tablename}\" maxlength=\"80\" />\n";
         for ($j = 0; $j < count($Nams); $j++) {
             // clears out the form as some of the fields populate
             if (!isset($edit) or !$edit) {
                 $Fild[$j] = "";
             }
             // if comments are disabled then hide the field
             if ($Nams[$j] == 'comments' && !public_page_exists('comments')) {
                 echo "\t\t\t\t\t\t\t<input type=\"hidden\" class=\"form_text\" name=\"{$Nams[$j]}\" value=\"no\" maxlength=\"" . $Leng[$j] . "\" />\n";
                 $j++;
             }
             if (!in_array($Nams[$j], $this->exclude)) {
                 //fields populated and output depending on type etc.
                 //$searchfor = "_".first_word($Nams[$j]);
                 if ($Leng[$j] < 40) {
                     $ln = $Leng[$j];
                 } else {
                     if ($Leng[$j] <= 400) {
                         $ln = 50;
                     }
                 }
                 $nullf = explode(" ", $Flag[$j]);
                 if ($nullf[0] == 'not_null') {
                     // label required fields
                     if (isset($lang['form_' . $Nams[$j]])) {
                         if ($Nams[$j] != 'page_name' or $type == 'static' or !isset($edit) or !$edit) {
                             /* Prevents the editing of page_name which does not work in modules and dynamic pages */
                             $displayname = $lang['form_' . $Nams[$j]] . " <span class=\"form_required\">" . $lang['form_required'] . "</span>";
                         } else {
                             $displayname = " <span style=\"display:none\" class=\"form_required\">" . $lang['form_required'] . "</span>";
                         }
                     } else {
                         $displayname = simplify($Nams[$j]) . " <span class=\"form_required\">" . $lang['form_required'] . "</span>";
                     }
                 } else {
                     if (isset($lang['form_' . $Nams[$j]]) && $lang['form_' . $Nams[$j]]) {
                         $displayname = $lang['form_' . $Nams[$j]] . " <span class=\"form_optional\">" . $lang['form_optional'] . "</span>";
                     } else {
                         $displayname = simplify($Nams[$j]) . " <span class=\"form_optional\">" . $lang['form_optional'] . "</span>";
                     }
                 }
                 // check language file for any form help
                 if (isset($lang['form_help_' . $Nams[$j]]) && $lang['form_help_' . $Nams[$j]]) {
                     if ($Nams[$j] != 'page_name' or $type == 'static' or !isset($edit) or !$edit) {
                         /* Prevents the editing of page_name which does not work in modules and dynamic pages */
                         $form_help = "<span class=\"form_help\">" . $lang['form_help_' . $Nams[$j]] . "</span>";
                     } else {
                         $form_help = "<span style=\"display:none\" class=\"form_help\">" . $lang['form_help_' . $Nams[$j]] . "</span>";
                     }
                 } else {
                     $form_help = "";
                 }
                 if ($GLOBALS['rich_text_editor'] == 1) {
                     $containsphp = strlen(stristr(utf8_decode($Fild[$j]), '<?php')) > 0;
                     if ($containsphp) {
                         $form_help .= " <span class=\"alert\">" . $lang['form_php_warning'] . '</span>';
                     }
                 }
                 echo "\t\t\t\t\t\t\t<div class=\"form_row\">\n\t\t\t\t\t\t\t\t<div class=\"form_label\">\n\t\t\t\t\t<label for=\"{$Nams[$j]}\">" . $displayname . "</label>{$form_help}</div>\n";
                 //$Type[$j] $Leng[$j] $Flag[$j] for field info
                 //echo "$Nams[$j] - $Type[$j] - $Leng[$j] - $Flag[$j]"; // see form field properties
                 if ($Type[$j] == 'timestamp' && !isset($edit) && !$edit) {
                     echo "\t\t\t\t\t\t\t\t<div class=\"form_item_drop\">\n";
                     if (isset($date)) {
                         date_dropdown($date);
                     } else {
                         $date = NULL;
                         date_dropdown($date);
                     }
                     echo "\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                 } else {
                     if ($Type[$j] == 'timestamp' && isset($edit) && $edit) {
                         echo "\t\t\t\t\t\t\t\t<div class=\"form_item_drop\">\n";
                         date_dropdown($Fild[$j]);
                         echo "\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                         //} else if ($Type[$j] == "blob") {
                         //	echo "\t\t\t\t\t\t\t\t<div class=\"form_item_textarea\">\n\t\t\t\t\t\t\t\t<textarea name=\"$Nams[$j]\" class=\"form_item_textarea_no_ckeditor\">$Fild[$j]</textarea>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                     } else {
                         if ($Type[$j] == 'longtext' or $Leng[$j] > 800 or $Type[$j] == 'blob') {
                             if ($GLOBALS['rich_text_editor'] == 1) {
                                 if (!$containsphp) {
                                     echo "\t\t\t\t\t\t\t\t<div class=\"form_item_textarea_ckeditor\">\n\t\t\t\t\t\t\t\t\t\t<textarea name=\"{$Nams[$j]}\" id=\"{$Nams[$j]}\" cols=\"50\" class=\"ck-textarea\" rows=\"10\">" . htmlentities($Fild[$j], ENT_QUOTES, 'UTF-8') . "</textarea>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n";
                                     // id=\"$Nams[$j]\"
                                 } else {
                                     echo "\t\t\t\t\t\t\t\t<div class=\"form_item_textarea\">\n\t\t\t\t\t\t\t\t<textarea name=\"{$Nams[$j]}\" class=\"form_item_textarea_no_ckeditor\">" . htmlspecialchars($Fild[$j], ENT_QUOTES, 'UTF-8') . "</textarea>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                     // id=\"$Nams[$j]\"
                                 }
                             } else {
                                 echo "\t\t\t\t\t\t\t\t<div class=\"form_item_textarea\">\n\t\t\t\t\t\t\t\t<textarea name=\"{$Nams[$j]}\" class=\"form_item_textarea_no_ckeditor\">" . htmlspecialchars($Fild[$j], ENT_QUOTES, 'UTF-8') . "</textarea>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                 // id=\"$Nams[$j]\"
                             }
                         } else {
                             if ($Type[$j] == "set'yes','no'" or $Flag[$j] == 'not_null set') {
                                 if ($Fild[$j] == 'no') {
                                     echo "\t\t\t\t\t\t\t\t<div class=\"form_item_radio\">\n\t\t\t\t\t\t\t\tYes<input type=\"radio\" name=\"{$Nams[$j]}\" id=\"{$Nams[$j]}\" class=\"form_radio\" value=\"yes\" />\n\t   \t\t\t\t\t\t     \tNo<input checked=\"checked\" type=\"radio\" name=\"{$Nams[$j]}\" class=\"form_radio\" value=\"{$Fild[$j]}\" />\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t</div>\n";
                                 } else {
                                     echo "\t\t\t\t\t\t\t\t<div class=\"form_item_radio\">\n\t\t\t\t\t\t\t\tYes<input checked=\"checked\" type=\"radio\" name=\"{$Nams[$j]}\" id=\"{$Nams[$j]}\" class=\"form_radio\" value=\"yes\" />\n\t   \t\t\t\t\t\t     \tNo<input type=\"radio\" name=\"{$Nams[$j]}\" class=\"form_radio\" value=\"no\"/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                 }
                             } else {
                                 if (first_word($Nams[$j]) == 'image') {
                                     echo "\t\t\t\t\t\t\t\t<div class=\"form_item_drop image_preview\">\n";
                                     db_dropdown('pixie_files', $Fild[$j], $Nams[$j], "file_type = 'Image' order by file_id desc");
                                     echo "\n\t\t\t\t\t\t\t\t<span class=\"more_upload\">or <a href=\"#\" onclick=\"upswitch('" . $Nams[$j] . "'); return false;\" title=\"" . $lang['upload'] . "\">" . strtolower($lang['upload']) . "...</a></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                 } else {
                                     if (first_word($Nams[$j]) == 'document') {
                                         echo "\t\t\t\t\t\t\t\t<div class=\"form_item_drop\">\n";
                                         db_dropdown('pixie_files', $Fild[$j], $Nams[$j], "file_type = 'Other' order by file_id desc");
                                         echo "\n\t\t\t\t\t\t\t\t<span class=\"more_upload\">or <a href=\"#\" onclick=\"upswitch('" . $Nams[$j] . "'); return false;\" title=\"" . $lang['upload'] . "\">" . strtolower($lang['upload']) . "...</a></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                     } else {
                                         if (first_word($Nams[$j]) == 'video') {
                                             echo "\t\t\t\t\t\t\t\t<div class=\"form_item_drop\">\n";
                                             db_dropdown('pixie_files', $Fild[$j], $Nams[$j], "file_type = 'Video' order by file_id desc");
                                             echo "\n\t\t\t\t\t\t\t\t<span class=\"more_upload\">or <a href=\"#\" onclick=\"upswitch('" . $Nams[$j] . "'); return false;\" title=\"" . $lang['upload'] . "\">" . strtolower($lang['upload']) . "...</a></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                         } else {
                                             if (first_word($Nams[$j]) == 'audio') {
                                                 echo "\t\t\t\t\t\t\t\t<div class=\"form_item_drop\">\n";
                                                 db_dropdown('pixie_files', $Fild[$j], $Nams[$j], "file_type = 'Audio' order by file_id desc");
                                                 echo "\n\t\t\t\t\t\t\t\t<span class=\"more_upload\">or <a href=\"#\" onclick=\"upswitch('" . $Nams[$j] . "'); return false;\" title=\"" . $lang['upload'] . "\">" . strtolower($lang['upload']) . "...</a></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                             } else {
                                                 if (first_word($Nams[$j]) == 'file') {
                                                     echo "\t\t\t\t\t\t\t\t<div class=\"form_item_drop\">\n";
                                                     db_dropdown('pixie_files', $Fild[$j], $Nams[$j], "file_id >= '0' order by file_id desc");
                                                     echo "\n\t\t\t\t\t\t\t\t<span class=\"more_upload\">or <a href=\"#\" onclick=\"upswitch('" . $Nams[$j] . "'); return false;\" title=\"" . $lang['upload'] . "\">" . strtolower($lang['upload']) . "...</a></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                                 } else {
                                                     if ($Nams[$j] == 'tags') {
                                                         $tableid = 0;
                                                         $condition = $tableid . " >= '0'";
                                                         form_tag($this->tablename, $condition);
                                                         echo "\t\t\t\t\t\t\t\t<div class=\"form_item\">\n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_text\" name=\"{$Nams[$j]}\" id=\"{$Nams[$j]}\" value=\"{$Fild[$j]}\" size=\"";
                                                         if (isset($ln)) {
                                                             echo $ln;
                                                         } else {
                                                             $ln = 25;
                                                             echo $ln;
                                                         }
                                                         echo "\" maxlength=\"" . $Leng[$j] . "\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                                     } else {
                                                         if ($Nams[$j] == 'page_blocks') {
                                                             form_blocks();
                                                             echo "\t\t\t\t\t\t\t\t<div class=\"form_item\">\n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_text\" name=\"{$Nams[$j]}\" id=\"{$Nams[$j]}\" value=\"{$Fild[$j]}\" size=\"";
                                                             if (isset($ln)) {
                                                                 echo $ln;
                                                             } else {
                                                                 $ln = 25;
                                                                 echo $ln;
                                                             }
                                                             echo "\" maxlength=\"" . $Leng[$j] . "\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                                         } else {
                                                             if ($Nams[$j] == 'privs') {
                                                                 if ($Fild[$j] == 2) {
                                                                     $adminclass = "selected=\"selected\"";
                                                                     $everyoneclass = NULL;
                                                                 } else {
                                                                     $everyoneclass = "selected=\"selected\"";
                                                                     $adminclass = NULL;
                                                                 }
                                                                 echo "\t\t\t\t\t\t\t\t<div class=\"form_item_drop\">\n\t\t\t\t\t\t\t\t\t<select class=\"form_select\" name=\"{$Nams[$j]}\" name=\"{$Nams[$j]}\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"2\" {$adminclass}>Administrators only</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"1\" {$everyoneclass}>Administrators &amp; Clients</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t   \t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n";
                                                             } else {
                                                                 if ($Nams[$j] != 'page_name' or $type == 'static' or !isset($edit) or !$edit) {
                                                                     /* Prevents the editing of page_name which does not work in modules and dynamic pages */
                                                                     echo "\t\t\t\t\t\t\t\t<div class=\"form_item\">\n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_text\" name=\"{$Nams[$j]}\" id=\"{$Nams[$j]}\" value=\"" . htmlspecialchars($Fild[$j], ENT_QUOTES, 'UTF-8') . "\" size=\"";
                                                                     if (isset($ln)) {
                                                                         echo $ln;
                                                                     } else {
                                                                         $ln = 25;
                                                                         echo $ln;
                                                                     }
                                                                     echo "\" maxlength=\"" . $Leng[$j] . "\" />\n\t\t\t\t\t\t\t\t</div>";
                                                                 } else {
                                                                     echo "\t\t\t\t\t\t\t\t<div style=\"display:none\" class=\"form_item\">\n\t\t\t\t\t\t\t\t<input style=\"display:none\" type=\"text\" class=\"form_text\" name=\"{$Nams[$j]}\" id=\"{$Nams[$j]}\" value=\"" . htmlspecialchars($Fild[$j], ENT_QUOTES, 'UTF-8') . "\" size=\"";
                                                                     if (isset($ln)) {
                                                                         echo $ln;
                                                                     } else {
                                                                         $ln = 25;
                                                                         echo $ln;
                                                                     }
                                                                     echo "\" maxlength=\"" . $Leng[$j] . "\" />\n\t\t\t\t\t\t\t\t</div>";
                                                                 }
                                                                 echo "\n\t\t\t\t\t\t\t</div>\n";
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 //other field types still to come: File uploads...?
                 //hidden fields populated
             } else {
                 if ($Nams[$j] == 'page_id' && isset($s) && $s == 'publish' && $m == 'dynamic') {
                     $page_id = get_page_id($x);
                     echo "\t\t\t\t\t\t\t<input type=\"hidden\" class=\"form_text\" name=\"{$Nams[$j]}\" value=\"{$page_id}\" maxlength=\"" . $Leng[$j] . "\" />\n";
                 } else {
                     if (last_word($Nams[$j]) == 'id') {
                         echo "\t\t\t\t\t\t\t<input type=\"hidden\" class=\"form_text\" name=\"{$Nams[$j]}\" value=\"{$Fild[$j]}\" maxlength=\"" . $Leng[$j] . "\" />\n";
                     } else {
                         if ($Nams[$j] == 'author') {
                             if (isset($edit) && $edit) {
                                 $output = $Fild[$j];
                             } else {
                                 if (!isset($GLOBALS['pixie_user'])) {
                                     $GLOBALS['pixie_user'] = NULL;
                                 }
                                 $output = $GLOBALS['pixie_user'];
                             }
                             echo "\t\t\t\t\t\t\t<input type=\"hidden\" class=\"form_text\" name=\"{$Nams[$j]}\" value=\"" . $output . "\" maxlength=\"" . $Leng[$j] . "\" />\n";
                         } else {
                             if ($Type[$j] == "timestamp") {
                                 echo "\t\t\t\t\t\t\t<input type=\"hidden\" class=\"form_text\" name=\"{$Nams[$j]}\" value=\"" . returnSQLtimestamp(time()) . "\" maxlength=\"" . $Leng[$j] . "\" />\n";
                             } else {
                                 if ($Nams[$j] == 'page_type') {
                                     if ($type) {
                                         $output = $type;
                                     } else {
                                         if (isset($edit)) {
                                             $output = safe_field('page_type', 'pixie_core', "page_id='{$edit}'");
                                         }
                                     }
                                     echo "\t\t\t\t\t\t\t<input type=\"hidden\" class=\"form_text\" name=\"{$Nams[$j]}\" value=\"" . $output . "\" maxlength=\"" . $Leng[$j] . "\" />\n";
                                 } else {
                                     if ($Nams[$j] == 'publish' && !$edit) {
                                         echo "\t\t\t\t\t\t\t<input type=\"hidden\" class=\"form_text\" name=\"{$Nams[$j]}\" value=\"yes\" maxlength=\"0\" />\n";
                                     } else {
                                         if ($Nams[$j] == 'page_content') {
                                             // do nothing
                                         } else {
                                             if ($Nams[$j] == 'admin') {
                                                 // do nothing
                                             } else {
                                                 echo "\t\t\t\t\t\t\t<input type=\"hidden\" class=\"form_text\" name=\"{$Nams[$j]}\" value=\"{$Fild[$j]}\" maxlength=\"" . $Leng[$j] . "\" />\n";
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         if (isset($edit) && $edit) {
             echo "\t\t\t\t\t\t\t<div class=\"form_row_button\">\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"submit_edit\" class=\"form_submit\" value=\"" . $lang['form_button_update'] . "\" />\n\t\t\t\t\t\t\t</div>\n";
         } else {
             if (isset($go) && $go == 'new') {
                 // do a save draft and save button button?? - when everything can be saved as a draft and is autosaved using AJAX
             } else {
                 echo "\t\t\t\t\t\t\t<div class=\"form_row_button\" id=\"form_button\">\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"submit_new\" class=\"form_submit\" value=\"" . $lang['form_button_save'] . "\" />\n\t\t\t\t\t\t\t</div>\n";
             }
         }
         if ($m != 'static') {
             echo "\t\t\t\t\t\t\t<div class=\"form_row_button\">\n\t\t\t\t\t\t\t\t<span class=\"form_button_cancel\"><a href=\"?s={$s}&amp;m={$m}&amp;x={$x}\" title=\"" . $lang['form_button_cancel'] . "\">" . $lang['form_button_cancel'] . "</a></span>\n\t\t\t\t\t\t\t</div>\n";
         }
         echo "\t\t\t\t\t\t\t<div class=\"safclear\"></div>\n\t\t\t\t\t\t</fieldset>\n";
         echo "\t\t\t\t\t</form>";
     }
 }
Example #16
0
    echo $wiki;
    ?>
/wiki/User:<?php 
    echo $judged_by;
    ?>
"><?php 
    echo $judged_by;
    ?>
</a></td>
        </tr>
        <?php 
}
$newer_pageids = [];
foreach ($all_verdicts as $page_title => $data) {
    if (!isset($page_shown[$page_title])) {
        $page_id = get_page_id($page_title, $wiki);
        if ($page_id >= 0) {
            array_push($newer_pageids, $page_id);
        }
    }
}
$newer_page_sizes = get_page_size($newer_pageids, $wiki)['query']['pages'];
if ($newer_page_sizes) {
    foreach ($newer_page_sizes as $page_id => $data) {
        $page_size = $data['revisions'][0]['size'];
        $status = !empty($all_verdicts[$data['title']]) ? $all_verdicts[$data['title']]['verdict'] : "pending";
        $remarks = isset($all_verdicts[$data['title']]) ? $all_verdicts[$data['title']]['remarks'] : "";
        $judged_by = isset($all_verdicts[$data['title']]) ? $all_verdicts[$data['title']]['last_updated_by'] : "";
        ?>
            <tr>
                <td><a href="//<?php 
Example #17
0
            ?>
">Blog</a>
								<?php 
        } else {
            if (in_category(get_cat_id('Events'))) {
                ?>
									<a href="<?php 
                echo get_permalink(get_page_id('Events'));
                ?>
">Events</a>
								<?php 
            } else {
                if (in_category(get_cat_id('Companies'))) {
                    ?>
									<a href="<?php 
                    echo get_permalink(get_page_id('Companies'));
                    ?>
">Companies</a>
								<?php 
                } else {
                    ?>
								<?php 
                    the_category(', ');
                }
            }
        }
        ?>
                            </span>
                            <br class="clear" /><br />
                            
                            <?php 
Example #18
0
/**
 * Like Bar
 * Includes facebook likes, +1's
 */
function likes_bar($args = array())
{
    $bar_id = empty($args['id']) || $args['id'] == null ? '' : 'id="' . $args['id'] . '"';
    $bar_class;
    $fb_url;
    if ($args['facebook']['data-href'] == null || empty($args['facebook']['data-href'])) {
        if (get_page_id() == 'index') {
            $fb_url = get_site_url();
        } else {
            $fb_url = get_site_url() . '/' . get_current_file();
        }
    } else {
        $fb_url = $args['facebook']['data-href'];
    }
    // Facebook defaults
    $fb_defaults = array('data-layout' => 'button_count', 'data-action' => 'like', 'data-show-faces' => 'false', 'data-share' => 'false', 'data-colorscheme' => 'light');
    // Google defaults
    $gg_defaults = array('data-size' => 'medium', 'data-annotation' => 'bubble', 'data-align' => 'left', 'expandTo' => '', 'data-recommendations' => 'false');
    // Assign defaults to variables
    $fb_options = empty($args['facebook']) || $args['facebook'] == null ? $fb_defaults : $args['facebook'];
    $gg_options = empty($args['google']) || $args['google'] == null ? $gg_defaults : $args['google'];
    if ($args['bar_style'] == 'standard' || empty($args['bar_style']) || $args['bar_style'] == null) {
        // set class attribute for like bar
        $bar_class = 'standard-bar';
        printf('<div class="like-bar %s"><ul>', $bar_class);
        if ($args['facebook'] != false || empty($args['facebook']) || $args['facebook'] == null) {
            printf('<li class="wgt-button"><div class="fb-like"');
            foreach ($fb_options as $data => $value) {
                printf(' %1$s="%2$s"', $data, $value);
            }
            printf('></div><!-- .fb-like --></li>');
        }
        if ($args['google'] != false || empty($args['google']) || $args['google'] == null) {
            printf('<li class="wgt-button"><div class="g-plusone"');
            foreach ($gg_options as $data => $value) {
                printf(' %1$s="%2$s"', $data, $value);
            }
            printf('></div><!-- .g-plusone --></li>');
        }
        printf('</ul></div>');
    } elseif ($args['bar_style'] == 'drawer') {
        // Set class attribute for like bar
        $bar_class = 'drawer-bar';
        $fb_counts = reset(get_fb_counts($fb_url));
        printf('<div class="like-bar %1$s"><ul><li class="wgt-button"><div class="fb-top wgt-cover"><span class="count-box">%2$s</span></div><div class="fb-like"', $bar_class, $fb_counts->like_count);
        foreach ($fb_options as $data => $value) {
            printf(' %1$s="%2$s"', $data, $value);
        }
        printf('></div><!-- .fb-like --></li><li class="wgt-button"><div class="gg-top wgt-cover"><span class="count-box">%s</span></div><div class="g-plusone"', $gg_counts);
        foreach ($gg_options as $data => $value) {
            printf(' %1$s="%2$s"', $data, $value);
        }
        printf('></div><!-- .g-plusone --></li></ul></div>');
    }
}
Example #19
0
    public function process_block_modules()
    {
        global $phpbb_root_path, $config, $table_prefix, $helper;
        global $db, $user, $avatar_img, $request, $template, $auth;
        global $k_config, $k_groups, $k_blocks, $page_header;
        global $phpbb_path_helper;
        $this->php_ext = $phpbb_path_helper->get_php_ext();
        $block_cache_time = $k_config['k_block_cache_time_default'];
        $blocks_width = $config['blocks_width'];
        $blocks_enabled = $config['blocks_enabled'];
        $use_block_cookies = isset($k_config['use_block_cookies']) ? $k_config['use_block_cookies'] : 0;
        if (!$blocks_enabled) {
            $template->assign_vars(array('PORTAL_MESSAGE' => $user->lang('BLOCKS_DISABLED')));
        }
        $all = '';
        $show_center = $show_left = $show_right = false;
        $LB = $CB = $RB = array();
        $active_blocks = array();
        // if styles use large block images change path to images //
        $block_image_path = $phpbb_root_path . 'ext/phpbbireland/portal/images/block_images/block/';
        $big_image_path = $phpbb_root_path . 'ext/phpbbireland/portal/images/block_images/large/';
        $this_page = explode(".", $user->page['page']);
        $user_id = $user->data['user_id'];
        //		$logo = sgp_get_rand_logo();
        //		var_dump($logo);
        $theme = rawurlencode($user->style['style_path']);
        $template->assign_vars(array('EXT_TEMPLATE_PATH' => $phpbb_root_path . 'ext/phpbbireland/portal/styles/' . $theme, 'EXT_IMAGE_PATH' => $phpbb_root_path . 'ext/phpbbireland/portal/images/', 'MOD_IMAGE_LANG_PATH' => $phpbb_root_path . 'ext/phpbbireland/portal/styles/' . $theme . '/theme/' . $user->data['user_lang'] . '/'));
        include_once $phpbb_root_path . 'ext/phpbbireland/portal/includes/sgp_functions.' . $this->php_ext;
        // Grab data for this user //
        $sql = "SELECT group_id, user_type, user_style, user_avatar, user_avatar_type, username, user_left_blocks, user_center_blocks, user_right_blocks\n\t\t\tFROM " . USERS_TABLE . "\n\t\t\tWHERE user_id = {$user_id}";
        if ($result = $db->sql_query($sql)) {
            $row = $db->sql_fetchrow($result);
            $user_avatar = $row['user_avatar'];
            $user_style = $row['user_style'];
            $usertype = $row['user_type'];
            $groupid = $row['group_id'];
            $left = $row['user_left_blocks'];
            $LB = explode(',', $left);
            $center = $row['user_center_blocks'];
            $CB = explode(',', $center);
            $right = $row['user_right_blocks'];
            $RB = explode(',', $right);
            $LCR = array_merge((array) $LB, (array) $CB, (array) $RB);
            $left .= ',';
            $center .= ',';
            $all .= $left .= $center .= $right;
        } else {
            trigger_error($user->lang['ERROR_USER_TABLE']);
        }
        // Process block positions for members only //
        if ($row['group_id'] != ANONYMOUS) {
            if (isset($_COOKIE[$config['cookie_name'] . '_sgp_left']) || isset($_COOKIE[$config['cookie_name'] . '_sgp_center']) || isset($_COOKIE[$config['cookie_name'] . '_sgp_right']) && $use_block_cookies) {
                $left = $request->variable($config['cookie_name'] . '_sgp_left', '', false, true);
                $left = str_replace("left[]=", "", $left);
                $left = str_replace("&amp;", ',', $left);
                $LBA = explode(',', $left);
                $center = $request->variable($config['cookie_name'] . '_sgp_center', '', false, true);
                $center = str_replace("center[]=", "", $center);
                $center = str_replace("&amp;", ',', $center);
                $CBA = explode(',', $center);
                $right = $request->variable($config['cookie_name'] . '_sgp_right', '', false, true);
                $right = str_replace("right[]=", "", $right);
                $right = str_replace("&amp;", ',', $right);
                $RBA = explode(',', $right);
                // store cookie data (block positions in user table)
                if (!empty($left)) {
                    $sql = 'UPDATE ' . USERS_TABLE . '
						SET user_left_blocks = ' . "'" . $db->sql_escape($left) . "'" . ', user_center_blocks = ' . "'" . $db->sql_escape($center) . "'" . ', user_right_blocks = ' . "'" . $db->sql_escape($right) . "'" . '
						WHERE user_id = ' . (int) $user->data['user_id'];
                    $db->sql_query($sql);
                    // set switch clear cookies now that we have them stored (we use javascript)//
                    $template->assign_vars(array('S_CLEAR_CACHE' => true));
                }
            }
            if (empty($row['user_left_blocks'])) {
                $sql = "SELECT *\n\t\t\t\t\tFROM " . K_BLOCKS_TABLE . "\n\t\t\t\t\tWHERE active = 1\n\t\t\t\t\t\tAND (view_pages <> '0')\n\t\t\t\t\t\tORDER BY ndx ASC";
            } else {
                $sql = "SELECT *\n\t\t\t\t\tFROM " . K_BLOCKS_TABLE . "\n\t\t\t\t\tWHERE active = 1\n\t\t\t\t\t\tAND (view_pages <> '0')\n\t\t\t\t\t\tAND " . $db->sql_in_set('id', $LCR) . "\n\t\t\t\t\tORDER BY find_in_set(id,'" . $all . "')";
            }
        } else {
            $sql = "SELECT *\n\t\t\t\tFROM " . K_BLOCKS_TABLE . "\n\t\t\t\tWHERE active = 1\n\t\t\t\t\t\tAND (view_pages <> '0')\n\t\t\t\t\t\tORDER BY ndx ASC";
        }
        $result = $db->sql_query($sql, $block_cache_time);
        while ($row = $db->sql_fetchrow($result)) {
            $active_blocks[] = $row;
            $arr[$row['id']] = explode(',', $row['view_pages']);
        }
        $this_page_name = $this->get_current_page();
        $id = $request->variable('style', 0);
        if ($id) {
            if (strstr($this_page_name, 'portal')) {
                $page_id = get_page_id('portal');
            } else {
                if (strstr($this_page_name, 'index')) {
                    $page_id = get_page_id('index');
                } else {
                    $page_id = get_page_id($this_page_name);
                }
            }
        } else {
            $page_id = get_page_id($this_page_name);
        }
        //var_dump('RETURNED: ' . $this_page_name . ' ID: ' . $page_id);
        if ($page_id == 0) {
            $page_id = $this_page[0];
            $page_id = get_page_id($this_page[0]);
        }
        foreach ($active_blocks as $active_block) {
            $filename = substr($active_block['html_file_name'], 0, strpos($active_block['html_file_name'], '.'));
            if (file_exists($phpbb_root_path . 'ext/phpbbireland/portal/blocks/' . $filename . '.' . $this->php_ext)) {
                if (in_array($page_id, $arr[$active_block['id']])) {
                    //var_dump('process_block_modules > foreach returned' . $filename);
                    include $phpbb_root_path . 'ext/phpbbireland/portal/blocks/' . $filename . '.' . $this->php_ext;
                }
            }
        }
        $db->sql_freeresult($result);
        if (!function_exists('group_memberships')) {
            include $phpbb_root_path . 'includes/functions_user.' . $this->php_ext;
        }
        $memberships = array();
        $memberships = group_memberships(false, $user->data['user_id'], false);
        // Main processing of block data here //
        if ($active_blocks) {
            $L = $R = $C = 0;
            foreach ($active_blocks as $row) {
                $block_position = $row['position'];
                // override default position with user designated position //
                if (in_array($row['id'], $LB)) {
                    $block_position = 'L';
                } else {
                    if (in_array($row['id'], $CB)) {
                        $block_position = 'C';
                    } else {
                        if (in_array($row['id'], $RB)) {
                            $block_position = 'R';
                        }
                    }
                }
                $block_id = $row['id'];
                $block_ndx = $row['ndx'];
                $block_title = $row['title'];
                $block_active = $row['active'];
                $block_type = $row['type'];
                $block_view_groups = $row['view_groups'];
                $block_view_all = $row['view_all'];
                $block_scroll = $row['scroll'];
                $block_height = $row['block_height'];
                $html_file_name = $row['html_file_name'];
                $img_file_name = $row['img_file_name'];
                $view_pages = $row['view_pages'];
                $arr = explode(',', $view_pages);
                $grps = explode(",", $block_view_groups);
                $process_block = false;
                $block_title = get_menu_lang_name($row['title']);
                // process blocks for different groups //
                if (isset($memberships)) {
                    foreach ($memberships as $member) {
                        // First we check to see if the view_all over-ride is set (saves having to enter all groups) //
                        if ($block_view_all) {
                            $process_block = true;
                        } else {
                            for ($j = 0; $j < ($jcount = count($grps)); $j++) {
                                if ($grps[$j] == $member['group_id']) {
                                    $process_block = true;
                                }
                            }
                        }
                    }
                    //unset($memberships);
                }
                if ($process_block && in_array($page_id, $arr)) {
                    switch ($block_position) {
                        case 'L':
                            $left_block_ary[$L] = $html_file_name;
                            $left_block_id[$L] = $block_id;
                            $left_block_ndx[$L] = $block_ndx;
                            $left_block_title[$L] = $block_title;
                            $left_block_img[$L] = $img_file_name;
                            $left_block_scroll[$L] = $block_scroll;
                            $left_block_height[$L] = $block_height;
                            $L++;
                            $show_left = true;
                            //show_blocks($this_page_name, $block_position);
                            break;
                        case 'C':
                            $center_block_ary[$C] = $html_file_name;
                            $center_block_id[$C] = $block_id;
                            $center_block_ndx[$C] = $block_ndx;
                            $center_block_title[$C] = $block_title;
                            $center_block_img[$C] = $img_file_name;
                            $center_block_scroll[$C] = $block_scroll;
                            $center_block_height[$C] = $block_height;
                            $C++;
                            $show_center = true;
                            //show_blocks($this_page_name, $block_position);
                            break;
                        case 'R':
                            $right_block_ary[$R] = $html_file_name;
                            $right_block_id[$R] = $block_id;
                            $right_block_ndx[$R] = $block_ndx;
                            $right_block_title[$R] = $block_title;
                            $right_block_img[$R] = $img_file_name;
                            $right_block_scroll[$R] = $block_scroll;
                            $right_block_height[$R] = $block_height;
                            $R++;
                            $show_right = true;
                            //show_blocks($this_page_name, $block_position);
                            break;
                        default:
                    }
                    ///var_dump($html_file_name);
                }
            }
        }
        //unset($active_blocks);
        if (isset($left_block_ary) && $show_left) {
            foreach ($left_block_ary as $block => $value) {
                $template->assign_block_vars('left_block_files', array('LEFT_BLOCKS' => $this->build_block_modules($value), 'LEFT_BLOCK_ID' => 'L_' . $left_block_id[$block], 'LEFT_BLOCK_TITLE' => $left_block_title[$block], 'LEFT_BLOCK_SCROLL' => $left_block_scroll[$block], 'LEFT_BLOCK_HEIGHT' => $left_block_height[$block], 'LEFT_BLOCK_IMG' => $left_block_img[$block] ? $block_image_path . $left_block_img[$block] : $block_image_path . 'none.gif', 'LEFT_BLOCK_IMG_2' => file_exists($big_image_path . $left_block_img[$block]) ? $big_image_path . $left_block_img[$block] : $big_image_path . 'none.png', 'S_CONTENT_FLOW_BEGIN' => $user->lang['DIRECTION'] == 'ltr' ? 'left' : 'right', 'S_CONTENT_FLOW_END' => $user->lang['DIRECTION'] == 'ltr' ? 'right' : 'left'));
            }
        }
        //unset($left_block_ary);
        if (isset($right_block_ary) && $show_right) {
            foreach ($right_block_ary as $block => $value) {
                $template->assign_block_vars('right_block_files', array('RIGHT_BLOCKS' => $this->build_block_modules($value), 'RIGHT_BLOCK_ID' => 'R_' . $right_block_id[$block], 'RIGHT_BLOCK_TITLE' => $right_block_title[$block], 'RIGHT_BLOCK_SCROLL' => $right_block_scroll[$block], 'RIGHT_BLOCK_HEIGHT' => $right_block_height[$block], 'RIGHT_BLOCK_IMG' => $right_block_img[$block] ? $block_image_path . $right_block_img[$block] : $block_image_path . 'none.gif', 'RIGHT_BLOCK_IMG_2' => file_exists($big_image_path . $right_block_img[$block]) ? $big_image_path . $right_block_img[$block] : $big_image_path . 'none.png', 'S_CONTENT_FLOW_BEGIN' => $user->lang['DIRECTION'] == 'ltr' ? 'left' : 'right', 'S_CONTENT_FLOW_END' => $user->lang['DIRECTION'] == 'ltr' ? 'right' : 'left'));
            }
        }
        //unset($right_block_ary);
        if (isset($center_block_ary) && $show_center) {
            foreach ($center_block_ary as $block => $value) {
                $template->assign_block_vars('center_block_files', array('CENTER_BLOCKS' => $this->build_block_modules($value), 'CENTER_BLOCK_ID' => 'C_' . $center_block_id[$block], 'CENTER_BLOCK_TITLE' => $center_block_title[$block], 'CENTER_BLOCK_SCROLL' => $center_block_scroll[$block], 'CENTER_BLOCK_HEIGHT' => $center_block_height[$block], 'CENTER_BLOCK_IMG' => $center_block_img[$block] ? $block_image_path . $center_block_img[$block] : $block_image_path . 'none.gif', 'CENTER_BLOCK_IMG_2' => file_exists($big_image_path . $center_block_img[$block]) ? $big_image_path . $center_block_img[$block] : $big_image_path . 'none.png', 'S_CONTENT_FLOW_BEGIN' => $user->lang['DIRECTION'] == 'ltr' ? 'left' : 'right', 'S_CONTENT_FLOW_END' => $user->lang['DIRECTION'] == 'ltr' ? 'right' : 'left'));
            }
        }
        //unset($center_block_ary);
        $avatar_data = array('avatar' => $user->data['user_avatar'], 'avatar_width' => $user->data['user_avatar_width'], 'avatar_height' => $user->data['user_avatar_height'], 'avatar_type' => $user->data['user_avatar_type']);
        $template->assign_vars(array('ASSETS_PATH' => $phpbb_root_path . 'ext/phpbbireland/portal/styles/' . rawurlencode($user->style['style_path']) . '/template/assets/', 'AVATAR' => phpbb_get_avatar($avatar_data, $user->lang['USER_AVATAR'], false), 'BLOCK_WIDTH' => $blocks_width . 'px', 'PORTAL_ACTIVE' => $config['portal_enabled'], 'PORTAL_BUILD' => $config['portal_build'], 'PORTAL_VERSION' => $config['portal_version'], 'READ_ARTICLE_IMG' => $user->img('btn_read_article', 'READ_ARTICLE'), 'POST_COMMENTS_IMG' => $user->img('btn_post_comments', 'POST_COMMENTS'), 'VIEW_COMMENTS_IMG' => $user->img('btn_view_comments', 'VIEW_COMMENTS'), 'SITE_NAME' => $config['sitename'], 'S_USER_LOGGED_IN' => $user->data['user_id'] != ANONYMOUS ? true : false, 'S_SHOW_LEFT_BLOCKS' => $show_left, 'S_SHOW_RIGHT_BLOCKS' => $show_right, 'S_BLOCKS_ENABLED' => $blocks_enabled, 'S_K_FOOTER_IMAGES_ALLOW' => $k_config['k_footer_images_allow'] ? true : false, 'S_CONTENT_FLOW_BEGIN' => $user->lang['DIRECTION'] == 'ltr' ? 'left' : 'right', 'S_CONTENT_FLOW_END' => $user->lang['DIRECTION'] == 'ltr' ? 'right' : 'left', 'USER_NAME' => $user->data['username'], 'USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'U_INDEX' => append_sid("{$phpbb_root_path}index.{$this->php_ext}"), 'U_PORTAL' => append_sid("{$phpbb_root_path}portal"), 'U_STAFF' => append_sid("{$phpbb_root_path}memberlist.{$this->php_ext}", 'mode=leaders'), 'U_SEARCH_BOOKMARKS' => append_sid("{$phpbb_root_path}ucp.{$this->php_ext}", 'i=main&mode=bookmarks'), 'PORTAL_HEADER_BLOCKS' => false, 'PORTAL_FOOTER_BLOCKS' => false, 'U_PORTAL_ARRANGE' => append_sid("{$phpbb_root_path}portal.{$this->php_ext}", "arrange=1"), 'S_ARRANGE' => false, 'HIDE_IMG' => '<img src="ext/phpbbireland/portal/images/hide.png"  alt="' . $user->lang['SHOWHIDE'] . '" title="' . $user->lang['SHOWHIDE'] . '" height="16" width="14" />', 'MOVE_IMG' => '<img src="ext/phpbbireland/portal/images/move.png"  alt="' . $user->lang['MOVE'] . '" title="' . $user->lang['MOVE'] . '" height="16" width="14" />', 'SHOW_IMG' => '<img src="ext/phpbbireland/portal/images/show.png"  alt="' . $user->lang['SHOW'] . '" title="' . $user->lang['SHOW'] . '" height="16" width="14" />'));
    }
Example #20
0
<?php

require 'inc/checklogin.php';
function get_page_id($contest_id)
{
    return floor(($contest_id - 1) / 10) + 1;
}
$page_id = 1;
if (isset($_GET['page_id'])) {
    $page_id = intval($_GET['page_id']);
} elseif (isset($_SESSION['view_contest'])) {
    $page_id = get_page_id($_SESSION['view_contest']);
}
require 'inc/database.php';
$contest_id_max = intval(mysql_fetch_row(mysql_query("SELECT MAX(contest_id) FROM contest"))[0]);
$page_id_max = get_page_id($contest_id_max);
if ($page_id < 1 || $page_id > $page_id_max) {
    die('Wrong Page ID.');
}
$contest_id_start = $page_id * 10 - 9;
$contest_id_end = $page_id * 10;
$contests = mysql_query("SELECT * FROM contest WHERE contest_id BETWEEN {$contest_id_start} AND {$contest_id_end} ORDER BY contest_id");
$Title = "Contestset {$page_id}";
?>

<!DOCTYPE html>
<html>
  <?php 
require 'head.php';
?>
Example #21
0
/**
 * Save a judgement to meta-wiki
 * @return void
 */
function do_judgement($verdict, $page_title, $username, $remarks, $wiki = null)
{
    global $settings;
    $wiki = isset($wiki) ? $wiki : $settings['main_page_wiki'];
    $ch = null;
    // First fetch the username
    $res = signed_api_query(array('format' => 'json', 'action' => 'query', 'meta' => 'userinfo'), $ch);
    if (isset($res->error->code) && $res->error->code === 'mwoauth-invalid-authorization') {
        // We're not authorized!
        echo 'You haven\'t authorized this application yet!';
        echo '<hr>';
        return;
    }
    if (!isset($res->query->userinfo)) {
        header("HTTP/1.1 {$settings['errorCode']} Internal Server Error");
        echo 'Bad API response: <pre>' . htmlspecialchars(var_export($res, 1)) . '</pre>';
        exit(0);
    }
    if (isset($res->query->userinfo->anon)) {
        header("HTTP/1.1 {$settings['errorCode']} Internal Server Error");
        echo 'Not logged in. (How did that happen?)';
        exit(0);
    }
    $current_username = $res->query->userinfo->name;
    $edit_page = str_replace(array("[wiki]", "[username]"), array($wiki, $username), $settings['judge_page_pattern']);
    $edit_page_id = get_page_id($edit_page);
    $edit_text = "";
    // check whether $edit_page exists
    if ($edit_page_id >= 0) {
        $q = get_judged_articles($username, $wiki);
        // $edit_page exists
        $page_content = $q[1];
        $article_judged = $q[0];
        if (in_array($page_title, $article_judged)) {
            // edit entry {{WAM-art | title = ... | verdict = ... | last_updated_by = ... | remarks = ... }}
            // $regex = "/\* {{WAM\-art \| title = " . preg_quote($page_title). " \| verdict = ([^|]*) \| last_updated_by = ([^|]*)( \| remarks = (.*) )?}}/";
            $regex = str_replace_first("(.+)", preg_quote($page_title), $settings['judge_verdict_pattern'], 1);
            $replacement = str_replace(array("[page_title]", "[verdict]", "[current_username]", "[remarks]"), array($page_title, $verdict, $current_username, $remarks), $settings['judge_verdict_wikitext_pattern']);
            $edit_text = preg_replace($regex, $replacement, $page_content);
        } else {
            // append entry {{WAM-art | title = ... | verdict = ... | last_updated_by = ... | remarks = ... }}
            $edit_text = $page_content . "\n" . str_replace(array("[page_title]", "[verdict]", "[current_username]", "[remarks]"), array($page_title, $verdict, $current_username, $remarks), $settings['judge_verdict_wikitext_pattern']);
        }
    } else {
        // $edit_page does not exist
        // input entry {{WAM-art | title = ... | verdict = ... | last_updated_by = ... | remarks = ... }}
        $edit_text = str_replace(array("[page_title]", "[verdict]", "[current_username]", "[remarks]"), array($page_title, $verdict, $current_username, $remarks), $settings['judge_verdict_wikitext_pattern']);
    }
    // Next fetch the edit token
    $res = signed_api_query(array('format' => 'json', 'action' => 'tokens', 'type' => 'edit'), $ch);
    if (!isset($res->tokens->edittoken)) {
        header("HTTP/1.1 {$settings['errorCode']} Internal Server Error");
        echo 'Bad API response: <pre>' . htmlspecialchars(var_export($res, 1)) . '</pre>';
        exit(0);
    }
    $token = $res->tokens->edittoken;
    // Now perform the edit
    $res = signed_api_query(array('format' => 'json', 'action' => 'edit', 'title' => $edit_page, 'text' => $edit_text, 'summary' => str_replace(array("[wiki]", "[username]", "[verdict]", "[page_title]"), array($wiki, $username, $verdict, $page_title), $settings['judge_edit_summary_pattern']), 'watchlist' => 'nochange', 'token' => $token), $ch);
    return $res->edit->result;
}
Example #22
0
             $process_block = true;
         } else {
             for ($j = 0; $j < ($jcount = count($grps)); $j++) {
                 if ($grps[$j] == $member['group_id']) {
                     $process_block = true;
                 }
             }
         }
     }
 }
 $this_page_name = $this_page[1];
 $this_page_name = str_replace('php/', '', $this_page_name);
 $page_id = get_page_id($this_page_name);
 if ($page_id == 0) {
     $page_id = $this_page[0];
     $page_id = get_page_id($this_page[0]);
 }
 if ($process_block && in_array($page_id, $arr)) {
     //var_dump($html_file_name);
     switch ($block_position) {
         case 'L':
             $left_block_ary[$L] = $html_file_name;
             $left_block_id[$L] = $block_id;
             $left_block_ndx[$L] = $block_ndx;
             $left_block_title[$L] = $block_title;
             $left_block_img[$L] = $img_file_name;
             $left_block_scroll[$L] = $block_scroll;
             $left_block_height[$L] = $block_height;
             $L++;
             $show_left = true;
             //show_blocks($this_page_name, $block_position);