Ejemplo n.º 1
0
                if ($ok_affich) {
                    echo '
            <option value="' . $forum_id . '">&nbsp;&nbsp;' . stripslashes($forum_name) . '</option>';
                }
            }
        }
    }
    echo '
         </select>
      </div>
   </div>
</form>
<a name="botofpage"></a>';
}
if ($SuperCache) {
    $cache_obj->endCachingBlock($cache_clef);
}
if ($Mmod and $forum_access != 9 or $adminforum == 1) {
    echo '
      <nav class="text-xs-center">
         <ul class="pagination pagination-sm">
            <li class="page-item disabled">
               <a class="page-link" href="#"><i class="fa fa-cogs fa-lg"></i>&nbsp;' . translate("Administration Tools") . '</a>
            </li>';
    if ($lock_state == 0) {
        echo '
            <li class="page-item">
               <a class="page-link" role="button" href="topicadmin.php?mode=lock&amp;topic=' . $topic . '&amp;forum=' . $forum . '" title="' . translate("Lock this Topic") . '" data-toggle="tooltip" ><i class="fa fa-lock fa-lg" aria-hidden="true"></i></a>
            </li>';
    } else {
        echo '
Ejemplo n.º 2
0
function fab_block($title, $member, $content, $Xcache)
{
    global $SuperCache, $CACHE_TIMINGS;
    // Multi-Langue
    $title = aff_langue($title);
    // Bloc caché
    $hidden = false;
    if (substr($content, 0, 7) == "hidden#") {
        $content = str_replace("hidden#", '', $content);
        $hidden = true;
    }
    // Si on cherche à charger un JS qui a déjà été chargé par pages.php alors on ne le charge pas ...
    global $pages_js;
    if ($pages_js != '') {
        preg_match('#src="([^"]*)#', $content, $jssrc);
        if (is_array($pages_js)) {
            foreach ($pages_js as $jsvalue) {
                if (array_key_exists('1', $jssrc)) {
                    if ($jsvalue == $jssrc[1]) {
                        $content = '';
                        break;
                    }
                }
            }
        } else {
            if (array_key_exists('1', $jssrc)) {
                if ($pages_js == $jssrc[1]) {
                    $content = "";
                }
            }
        }
    }
    $content = aff_langue($content);
    if ($SuperCache and $Xcache != 0) {
        $cache_clef = md5($content);
        $CACHE_TIMINGS[$cache_clef] = $Xcache;
        $cache_obj = new cacheManager();
        $cache_obj->startCachingBlock($cache_clef);
    } else {
        $cache_obj = new SuperCacheEmpty();
    }
    if ($cache_obj->genereting_output == 1 or $cache_obj->genereting_output == -1 or !$SuperCache or $Xcache == 0) {
        global $user, $admin;
        // For including CLASS AND URI in Block
        global $B_class_title, $B_class_content;
        $B_class_title = "";
        $B_class_content = "";
        $R_uri = "";
        if (stristr($content, "class-") or stristr($content, "uri")) {
            $tmp = explode("\n", $content);
            $content = "";
            while (list($id, $class) = each($tmp)) {
                $temp = explode("#", $class);
                if ($temp[0] == "class-title") {
                    $B_class_title = str_replace("\r", "", $temp[1]);
                } else {
                    if ($temp[0] == "class-content") {
                        $B_class_content = str_replace("\r", "", $temp[1]);
                    } else {
                        if ($temp[0] == "uri") {
                            $R_uri = str_replace("\r", "", $temp[1]);
                        } else {
                            if ($content != "") {
                                $content .= "\n ";
                            }
                            $content .= str_replace("\r", "", $class);
                        }
                    }
                }
            }
        }
        // For BLOC URIs
        if ($R_uri) {
            global $REQUEST_URI;
            $page_ref = basename($REQUEST_URI);
            $tab_uri = explode(" ", $R_uri);
            $R_content = false;
            $tab_pref = parse_url($page_ref);
            $racine_page = $tab_pref['path'];
            $tab_pref = explode("&", $tab_pref['query']);
            while (list(, $RR_uri) = each($tab_uri)) {
                $tab_puri = parse_url($RR_uri);
                $racine_uri = $tab_puri['path'];
                if ($racine_page == $racine_uri) {
                    $tab_puri = explode("&", $tab_puri['query']);
                    while (list($idx, $RRR_uri) = each($tab_puri)) {
                        if (substr($RRR_uri, -1) == "*") {
                            // si le token contient *
                            if (substr($RRR_uri, 0, strpos($RRR_uri, "=")) == substr($tab_pref[$idx], 0, strpos($tab_pref[$idx], "="))) {
                                $R_content = true;
                            }
                        } else {
                            // sinon
                            if ($RRR_uri != $tab_pref[$idx]) {
                                $R_content = false;
                            } else {
                                $R_content = true;
                            }
                        }
                    }
                }
            }
            if (!$R_content) {
                $content = '';
            }
        }
        // For Javascript in Block
        if (!stristr($content, "javascript")) {
            $content = nl2br($content);
        }
        // For including externale file in block / the return MUST BE in $content
        if (stristr($content, "include#")) {
            $Xcontent = false;
            // You can now, include AND cast a fonction with params in the same bloc !
            if (stristr($content, "function#")) {
                $content = str_replace("<br />", "", $content);
                $content = str_replace("<BR />", "", $content);
                $content = str_replace("<BR>", "", $content);
                $pos = strpos($content, "function#");
                $Xcontent = substr(trim($content), $pos);
                $content = substr(trim($content), 8, $pos - 10);
            } else {
                $content = substr(trim($content), 8);
            }
            include_once $content;
            if ($Xcontent) {
                $content = $Xcontent;
            }
        }
        if (!empty($content)) {
            if ($member == 1 and isset($user)) {
                if (!block_fonction($title, $content)) {
                    if (!$hidden) {
                        themesidebox($title, $content);
                    } else {
                        echo $content;
                    }
                }
            } elseif ($member == 0) {
                if (!block_fonction($title, $content)) {
                    if (!$hidden) {
                        themesidebox($title, $content);
                    } else {
                        echo $content;
                    }
                }
            } elseif ($member > 1 and isset($user)) {
                $tab_groupe = valid_group($user);
                if (groupe_autorisation($member, $tab_groupe)) {
                    if (!block_fonction($title, $content)) {
                        if (!$hidden) {
                            themesidebox($title, $content);
                        } else {
                            echo $content;
                        }
                    }
                }
            } elseif ($member == -1 and !isset($user)) {
                if (!block_fonction($title, $content)) {
                    if (!$hidden) {
                        themesidebox($title, $content);
                    } else {
                        echo $content;
                    }
                }
            } elseif ($member == -127 and isset($admin) and $admin) {
                if (!block_fonction($title, $content)) {
                    if (!$hidden) {
                        themesidebox($title, $content);
                    } else {
                        echo $content;
                    }
                }
            }
        }
        if ($SuperCache and $Xcache != 0) {
            $cache_obj->endCachingBlock($cache_clef);
        }
    }
}