Beispiel #1
0
        if (cur_charset != "utf-8") {
            $datetime = ucfirst($datetime);
        }
        echo '
        <tr>
           <td><a href="article.php?sid=' . $sid . '&amp;archive=' . $arch . '" >' . aff_langue($title) . '</a></td>
           <td>' . $counter . '</td>
           <td>' . $datetime . '</td>
           <td><a href="user.php?op=userinfo&amp;uname=' . $informant . '" >' . $informant . '</a></td>
           <td>' . $printP . '&nbsp;' . $sendF . '</td>
        </tr>';
    }
    echo '
         </tbody>
      </table><br />';
    $start = $start + $maxcount - 1;
    echo '
      <ul class="pagination pagination-sm">
         <li class="page-item disabled"><a class="page-link" href="#" >' . translate("Nb of articles") . ' ' . $count . ' </a></li>';
    if ($count - $start > 0) {
        echo '
         <li class="page-item"><a class="page-link" href="modules.php?ModPath=archive-stories&amp;ModStart=archive-stories&amp;start=' . $start . '&amp;count=' . $count . '" >' . translate("next matches") . '</a></li>';
    }
    echo '
      </ul>';
    echo "<p align=\"center\"><br />" . translate("Nb of articles") . " : {$count} - [ <a href=\"modules.php?ModPath=archive-stories&amp;ModStart=archive-stories\" class=\"noir\">" . translate("Go Back") . "</a> ]</p>";
}
if ($SuperCache) {
    $cache_obj->endCachingPage();
}
include "footer.php";
Beispiel #2
0
function viewarticle($artid, $page)
{
    global $NPDS_Prefix, $prev, $user, $numpage;
    $numpage = $page;
    if (file_exists("sections.config.php")) {
        include "sections.config.php";
    }
    if ($page == '') {
        sql_query("UPDATE " . $NPDS_Prefix . "seccont SET counter=counter+1 WHERE artid='{$artid}'");
    }
    $result_S = sql_query("SELECT artid, secid, title, content, counter, userlevel FROM " . $NPDS_Prefix . "seccont WHERE artid='{$artid}'");
    list($artid, $secid, $title, $Xcontent, $counter, $userlevel) = sql_fetch_row($result_S);
    list($secid, $secname, $rubid) = sql_fetch_row(sql_query("SELECT secid, secname, rubid FROM " . $NPDS_Prefix . "sections WHERE secid='{$secid}'"));
    list($rubname) = sql_fetch_row(sql_query("SELECT rubname FROM " . $NPDS_Prefix . "rubriques WHERE rubid='{$rubid}'"));
    $tmp_auto = explode(',', $userlevel);
    while (list(, $userlevel) = each($tmp_auto)) {
        $okprint = autorisation_section($userlevel);
        if ($okprint) {
            break;
        }
    }
    if ($okprint) {
        $old_title = $title;
        $pindex = substr(substr($page, 5), 0, -1);
        if ($pindex != '') {
            $pindex = ' - ' . translate("Next Page") . ' ' . $pindex;
        }
        if ($sections_chemin) {
            $title = aff_langue($rubname) . ' - ' . aff_langue($secname) . ' - ' . aff_langue($title) . ' ' . $pindex;
        } else {
            $title = aff_langue($title) . ' ' . $pindex;
        }
        include "header.php";
        $title = aff_langue($old_title);
        global $SuperCache;
        if ($SuperCache) {
            $cache_obj = new cacheManager();
            $cache_obj->startCachingPage();
        } else {
            $cache_obj = new SuperCacheEmpty();
        }
        if ($cache_obj->genereting_output == 1 or $cache_obj->genereting_output == -1 or !$SuperCache) {
            $words = sizeof(explode(' ', $Xcontent));
            if ($prev == 1) {
                echo '<input type="button" value="' . translate("Back to console") . '" onclick="javascript:history.back()" /><br /><br />';
            }
            if (function_exists("themesection_title")) {
                themesection_title($title);
            } else {
                echo '<h3>' . $title . '</h3>';
            }
            echo '<p class="text-muted">(' . $words . ' ' . translate("total words in this text)") . '&nbsp;-&nbsp;
         ' . translate("read:") . ' ' . $counter . ' ' . translate("times") . '&nbsp;&nbsp;&nbsp;<a href="sections.php?op=printpage&amp;artid=' . $artid . '" title="' . translate("Printer Friendly Page") . '" data-toggle="tooltip" ><i class="fa fa-print fa-lg"></i></a></p>';
            preg_match_all('#\\[page.*\\]#', $Xcontent, $rs);
            $ndepages = count($rs[0]);
            if ($page != '') {
                $Xcontent = substr($Xcontent, strpos($Xcontent, $page) + strlen($page));
                $multipage = true;
            } else {
                $multipage = false;
            }
            $pos_page = strpos($Xcontent, '[page');
            $longueur = mb_strpos($Xcontent, ']', $pos_page, 'iso-8859-1') - $pos_page + 1;
            if ($pos_page) {
                $pageS = substr($Xcontent, $pos_page, $longueur);
                $Xcontent = substr($Xcontent, 0, $pos_page);
                $Xcontent .= '
            <div class="center-block">
               <ul class="pagination pagination-sm">
               <li class="page-item disabled"><a class="page-link" href="#">' . $ndepages . ' pages</a></li>';
                if ($pageS !== '[page0]') {
                    $Xcontent .= '
                  <li class="page-item"><a class="page-link" href="sections.php?op=viewarticle&amp;artid=' . $artid . '">' . translate("Top of the article") . '</a></li>';
                }
                $Xcontent .= '
                  <li class="page-item active"><a class="page-link" href="#">' . preg_replace('#\\[(page)(.*)(\\])#', '\\1 \\2', $pageS) . '</a></li>
                  <li class="page-item"><a class="page-link" href="sections.php?op=viewarticle&amp;artid=' . $artid . '&amp;page=' . $pageS . '" >' . translate("Next Page") . '</a></li>
               </ul>
            </div>';
            } else {
                if ($multipage) {
                    $Xcontent .= '<br /><br /><p class=""><a href="sections.php?op=viewarticle&amp;artid=' . $artid . '&amp;page=[page0]">' . translate("Top of the article") . '</a></p>';
                }
            }
            $Xcontent = aff_code(aff_langue($Xcontent));
            echo meta_lang($Xcontent);
            $artidtempo = $artid;
            if ($rubname != "Divers") {
                echo '<p><a class="btn btn-secondary" href="sections.php">' . translate("Return to Sections Index") . '</a></p>';
                /*         echo '<h4>***<strong>'.translate("Back to chapter:").'</strong></h4>';
                            echo '<ul class="list-group"><li class="list-group-item"><a href="sections.php?op=listarticles&amp;secid='.$secid.'">'.aff_langue($secname).'</a></li></ul>';
                
                            $result3 = sql_query("SELECT artid, secid, title, userlevel FROM ".$NPDS_Prefix."seccont WHERE (artid<>'$artid' AND secid='$secid') ORDER BY ordre");
                            $nb_article = sql_num_rows($result3);
                            if ($nb_article > 0) {
                               echo '<h4>*<strong>'.translate("Other courses in chapter:").'</strong></h4>';
                               echo '<ul class="list-group">';
                               while (list($artid, $secid, $title, $userlevel) = sql_fetch_row($result3)) {
                                  $okprint2=autorisation_section($userlevel);
                                  if ($okprint2) {
                                     echo '<li class="list-group-item"><a href="sections.php?op=viewarticle&amp;artid='.$artid.'">'.aff_langue($title).'</a></li>';
                                  }
                              }
                              echo '</ul>';
                            }*/
            }
            $artid = $artidtempo;
            $resultconnexe = sql_query("SELECT id2 FROM " . $NPDS_Prefix . "compatsujet WHERE id1='{$artid}'");
            if (sql_num_rows($resultconnexe) > 0) {
                echo '<br />';
                echo "<strong>" . translate("You may be interested in:") . "</strong>";
                echo '<ul>';
                while (list($connexe) = sql_fetch_row($resultconnexe)) {
                    $resultpdtcompat = sql_query("SELECT artid, title, userlevel FROM " . $NPDS_Prefix . "seccont WHERE artid='{$connexe}'");
                    list($artid2, $title, $userlevel) = sql_fetch_row($resultpdtcompat);
                    $okprint2 = autorisation_section($userlevel);
                    if ($okprint2) {
                        echo '<li><a href="sections.php?op=viewarticle&amp;artid=' . $artid2 . '">' . aff_langue($title) . '</a></li>';
                    }
                }
                echo '</ul>';
            }
        }
        sql_free_result($result_S);
        if ($SuperCache) {
            $cache_obj->endCachingPage();
        }
        include 'footer.php';
    } else {
        header("Location: sections.php");
    }
}
Beispiel #3
0
function fiche_detail($Xlid)
{
    global $ModPath, $ModStart;
    include "header.php";
    // Include cache manager
    global $SuperCache;
    if ($SuperCache) {
        $cache_obj = new cacheManager();
        $cache_obj->startCachingPage();
    } else {
        $cache_obj = new SuperCacheEmpty();
    }
    if ($cache_obj->genereting_output == 1 or $cache_obj->genereting_output == -1 or !$SuperCache) {
        settype($xlid, 'integer');
        $browse_key = $Xlid;
        $link_fiche_detail = "fiche_detail";
        $inter = 'cid';
        include "modules/sform/links/link_detail.php";
    }
    if ($SuperCache) {
        $cache_obj->endCachingPage();
    }
    include "footer.php";
}
Beispiel #4
0
function theindex($op, $catid, $marqeur)
{
    include "header.php";
    // Include cache manager
    global $SuperCache;
    if ($SuperCache) {
        $cache_obj = new cacheManager();
        $cache_obj->startCachingPage();
    } else {
        $cache_obj = new SuperCacheEmpty();
    }
    if ($cache_obj->genereting_output == 1 or $cache_obj->genereting_output == -1 or !$SuperCache) {
        // Appel de la publication de News et la purge automatique
        automatednews();
        global $theme;
        if ($op == "newcategory" or $op == "newtopic" or $op == "newindex" or $op == "edito-newindex") {
            aff_news($op, $catid, $marqeur);
        } else {
            if (file_exists("themes/{$theme}/central.php")) {
                include "themes/{$theme}/central.php";
            } else {
                if ($op == "edito" or $op == "edito-nonews") {
                    aff_edito();
                }
                if ($op != "edito-nonews") {
                    aff_news($op, $catid, $marqeur);
                }
            }
        }
    }
    if ($SuperCache) {
        $cache_obj->endCachingPage();
    }
    include "footer.php";
}