Example #1
0
function fab_feed($type, $filename, $timeout)
{
    global $sitename, $slogan, $nuke_url, $backend_image, $backend_title, $backend_width, $backend_height, $backend_language, $storyhome;
    include "lib/feedcreator.class.php";
    $rss = new UniversalFeedCreator();
    $rss->useCached($type, $filename, $timeout);
    $rss->title = $sitename;
    $rss->description = $slogan;
    $rss->descriptionTruncSize = 250;
    $rss->descriptionHtmlSyndicated = true;
    $rss->link = $nuke_url;
    $rss->syndicationURL = $nuke_url . "/backend.php?op=" . $type;
    $image = new FeedImage();
    $image->title = $sitename;
    $image->url = $backend_image;
    $image->link = $nuke_url;
    $image->description = $backend_title;
    $image->width = $backend_width;
    $image->height = $backend_height;
    $rss->image = $image;
    $xtab = news_aff("index", "where ihome='0' and archive='0'", $storyhome, "");
    $story_limit = 0;
    while ($story_limit < $storyhome and $story_limit < sizeof($xtab)) {
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[$story_limit];
        $story_limit++;
        $item = new FeedItem();
        $item->title = preview_local_langue($backend_language, str_replace("&quot;", "\"", $title));
        $item->link = $nuke_url . "/article.php?sid={$sid}";
        $item->description = meta_lang(preview_local_langue($backend_language, $hometext));
        $item->descriptionHtmlSyndicated = true;
        $item->date = convertdateTOtimestamp($time) + $gmt * 3600;
        $item->source = $nuke_url;
        $item->author = $aid;
        $rss->addItem($item);
    }
    echo $rss->saveFeed($type, $filename);
}
Example #2
0
         <th data-sortable="true" data-halign="center" data-align="right">' . translate("reads") . '</th>
         <th data-halign="center" data-align="right">' . translate("Posted on") . '</th>
         <th data-sortable="true" data-halign="center" data-align="right">' . translate("Author") . '</th>
         <th data-halign="center" data-align="right">' . translate("Functions") . '</th>
      </tr>
   </thead>
   <tbody>';
 if (!isset($count)) {
     $result0 = Q_select("SELECT COUNT(sid) AS count FROM " . $NPDS_Prefix . "stories WHERE archive='{$arch}'", 3600);
     list(, $count) = each($result0);
     $count = $count['count'];
 }
 if ($arch == 0) {
     $xtab = news_aff("libre", "WHERE archive='{$arch}' ORDER BY sid DESC LIMIT {$start},{$maxcount}", $start, $maxcount);
 } else {
     $xtab = news_aff("archive", "WHERE archive='{$arch}' ORDER BY sid DESC LIMIT {$start},{$maxcount}", $start, $maxcount);
 }
 $ibid = 0;
 $story_limit = 0;
 while ($story_limit < $maxcount and $story_limit < sizeof($xtab)) {
     list($s_sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant) = $xtab[$story_limit];
     $story_limit++;
     if ($catid != 0) {
         list($cattitle) = sql_fetch_row(sql_query("SELECT title FROM " . $NPDS_Prefix . "stories_cat WHERE catid='{$catid}'"));
     }
     $printP = '<a href="print.php?sid=' . $s_sid . '&amp;archive=' . $arch . '"><i class="fa fa-print fa-lg" title="' . translate("Printer Friendly Page") . '" data-toggle="tooltip" data-placement="left"></i></a>';
     $sendF = '<a href="friend.php?op=FriendSend&amp;sid=' . $s_sid . '&amp;archive=' . $arch . '"><i class="fa fa-at fa-lg" title="' . translate("Send this Story to a Friend") . '" data-toggle="tooltip" data-placement="left" ></i></a>';
     $sid = $s_sid;
     if ($catid != 0) {
         $resultm = sql_query("SELECT title FROM " . $NPDS_Prefix . "stories_cat WHERE catid='{$catid}'");
         list($title1) = sql_fetch_row($resultm);
Example #3
0
function bigstory()
{
    global $cookie;
    $today = getdate();
    $day = $today['mday'];
    if ($day < 10) {
        $day = "0{$day}";
    }
    $month = $today['mon'];
    if ($month < 10) {
        $month = "0{$month}";
    }
    $year = $today['year'];
    $tdate = "{$year}-{$month}-{$day}";
    $xtab = news_aff("big_story", "WHERE (time LIKE '%{$tdate}%')", 0, 1);
    if (sizeof($xtab)) {
        list($fsid, $ftitle) = $xtab[0];
    } else {
        $fsid = '';
        $ftitle = '';
    }
    if (!$fsid and !$ftitle) {
        $content = translate("There isn't a Biggest Story for Today, yet.");
    } else {
        $content = translate("Today's most read Story is:") . "<br /><br />";
        $content .= "<a href=\"article.php?sid={$fsid}\">" . aff_langue($ftitle) . "</a>";
    }
    global $block_title;
    if ($block_title == '') {
        $boxtitle = translate("Today's Big Story");
    } else {
        $boxtitle = $block_title;
    }
    themesidebox($boxtitle, $content);
}
Example #4
0
function userinfo($uname)
{
    global $NPDS_Prefix;
    global $user, $sitename, $smilies, $short_user, $site_font;
    global $name, $email, $url, $bio, $user_avatar, $user_icq, $user_aim, $user_yim, $user_msnm, $user_from, $user_occ, $user_intrest, $user_sig, $user_journal;
    $uname = removeHack($uname);
    $result = sql_query("SELECT uid, name, femail, url, bio, user_avatar, user_icq, user_aim, user_yim, user_msnm, user_from, user_occ, user_intrest, user_sig, user_journal, mns FROM " . $NPDS_Prefix . "users WHERE uname='{$uname}'");
    list($uid, $name, $femail, $url, $bio, $user_avatar, $user_icq, $user_aim, $user_yim, $user_msnm, $user_from, $user_occ, $user_intrest, $user_sig, $user_journal, $mns) = sql_fetch_row($result);
    if (!$uid) {
        header("location: index.php");
    }
    global $cookie;
    include "header.php";
    include_once "functions.php";
    if ($uname == $cookie[1]) {
        echo '
      <h2>' . translate("User") . '</h2>
      <h3>' . $uname . ', ' . translate("Welcome to") . ' ' . $sitename . '</h3>
      <p class="lead">' . translate("This is your personal page") . '</p>';
        nav($mns);
    }
    $email = removeHack($femail);
    $name = stripslashes(removeHack($name));
    $url = removeHack($url);
    $bio = stripslashes(removeHack($bio));
    $user_icq = stripslashes(removeHack($user_icq));
    $user_aim = stripslashes(removeHack($user_aim));
    $user_yim = stripslashes(removeHack($user_yim));
    $user_msnm = stripslashes(removeHack($user_msnm));
    $user_from = stripslashes(removeHack($user_from));
    $user_occ = stripslashes(removeHack($user_occ));
    $user_intrest = stripslashes(removeHack($user_intrest));
    $user_sig = nl2br(removeHack($user_sig));
    $user_journal = stripslashes(removeHack($user_journal));
    $op = "userinfo";
    //    include("modules/sform/extend-user/aff_extend-user.php");// nul quel est l'intérêt d'afficher un form quui n'a pas la fonction de form ? mais une fonctions d'affichage désépérément figé dans la structure du form ????
    if (stristr($user_avatar, "users_private")) {
        $direktori = "";
    } else {
        global $theme;
        $direktori = "images/forum/avatar/";
        if (function_exists("theme_image")) {
            if (theme_image("forum/avatar/blank.gif")) {
                $direktori = "themes/{$theme}/images/forum/avatar/";
            }
        }
    }
    if ($uname == $cookie[1]) {
        echo '
   <div class="card text-xs-center">
      <div class="card-header">
         <img src="' . $direktori . $user_avatar . '" class="" />
         <p class="card-text card-title "></p>
      </div>
      <div class="card-block">
         <h3 class="card-title">' . $name . ' <span class="text-muted">alias</span> ' . $uname . '</h3>
         <p class="card-text">You can contact me @ ' . $email . ' ' . $user_icq . '</p>
         <p class="card-text">Don not forget to visit <a href="' . $url . '" class="oo">my web-site</a>';
        if ($mns) {
            echo ' OR my <a href="minisite.php?op=' . $uname . '" target="_blank">' . translate("Mini-Web site") . '</a>';
        }
        echo '
         </p>
      </div>
      <div class="card-footer text-muted">
         ' . $user_sig . '
      </div>
   </div>';
    }
    echo "<br />";
    echo '
    <h4>' . translate("Online journal for") . ' ' . $uname . '.</h4>
    <div id="online_user_journal" class="card card-block">' . $user_journal . '</div>';
    $file = '';
    $handle = opendir('modules/comments');
    while (false !== ($file = readdir($handle))) {
        if (!preg_match('#\\.conf\\.php$#i', $file)) {
            continue;
        }
        $topic = "#topic#";
        include "modules/comments/{$file}";
        $filelist[$forum] = $url_ret;
    }
    closedir($handle);
    echo '
    <h4>' . translate("Last 10 comments by") . ' ' . $uname . '.</h4>
    <div id="last_ten_comment" class="card card-block">';
    $url = '';
    $result = sql_query("SELECT topic_id, forum_id, post_text, post_time FROM " . $NPDS_Prefix . "posts WHERE forum_id<0 and poster_id='{$uid}' ORDER BY post_time DESC LIMIT 0,10");
    while (list($topic_id, $forum_id, $post_text, $post_time) = sql_fetch_row($result)) {
        $url = str_replace("#topic#", $topic_id, $filelist[$forum_id]);
        echo "<p><a href=\"" . $url . "\">" . translate("Posted: ") . convertdate($post_time) . "</a></p>";
        $message = smilie(stripslashes($post_text));
        $message = aff_video_yt($message);
        $message = str_replace('[addsig]', '', $message);
        if (stristr($message, "<a href")) {
            $message = preg_replace('#_blank(")#i', '_blank\\1 class=\\1noir\\1', $message);
        }
        echo $message . '<hr />';
    }
    echo '</div>';
    echo '
    <h4>' . translate("Last 10 news submissions sent by") . ' ' . $uname . '.</h4>
    <div id="last_ten_comment" class="card card-block">';
    $xtab = news_aff("libre", "WHERE informant='{$uname}' ORDER BY sid DESC LIMIT 10", "", 10);
    $story_limit = 0;
    while ($story_limit < 10 and $story_limit < sizeof($xtab)) {
        list($sid, $catid, $aid, $title) = $xtab[$story_limit];
        $story_limit++;
        echo "<p><a href=\"article.php?sid={$sid}\">" . aff_langue($title) . "</a></p>";
    }
    echo '</div>';
    include "footer.php";
}
Example #5
0
     $title1 = aff_langue(addslashes($title1));
     $boxstuff .= '
      <li><a href="article.php?sid=' . $sid1 . '&amp;archive=' . $archive . '" class="noir">' . aff_langue(stripslashes($title1)) . '</a></li>';
 }
 $boxstuff .= '
   </ul>
   <p align="center">
      <a href="friend.php?op=FriendSend&amp;sid=' . $sid . '&amp;archive=' . $archive . '"><i class="fa fa-lg fa-envelope-o mr-1" title="' . translate("Send this Story to a Friend") . '" data-toggle="tooltip"></i></a>
      <a href="print.php?sid=' . $sid . '&amp;archive=' . $archive . '" ><i class="fa fa-print fa-lg" title="' . translate("Printer Friendly Page") . '" data-toggle="tooltip"></i></a>
   </p>';
 if (!$archive) {
     $previous_tab = news_aff("libre", "WHERE sid<'{$sid}' ORDER BY sid DESC ", 0, 1);
     $next_tab = news_aff("libre", "WHERE sid>'{$sid}' ORDER BY sid ASC ", 0, 1);
 } else {
     $previous_tab = news_aff("archive", "WHERE sid<'{$sid}' ORDER BY sid DESC", 0, 1);
     $next_tab = news_aff("archive", "WHERE sid>'{$sid}' ORDER BY sid ASC ", 0, 1);
 }
 if (array_key_exists(0, $previous_tab)) {
     list($previous_sid) = $previous_tab[0];
 } else {
     $previous_sid = 0;
 }
 if (array_key_exists(0, $next_tab)) {
     list($next_sid) = $next_tab[0];
 } else {
     $next_sid = 0;
 }
 themearticle($aid, $informant, $time, $title, $bodytext, $topic, $topicname, $topicimage, $topictext, $sid, $previous_sid, $next_sid, $archive);
 // theme sans le système de commentaire en meta-mot !
 if (!function_exists("Caff_pub")) {
     if (file_exists("modules/comments/article.conf.php")) {
Example #6
0
function userinfo($uname)
{
    global $NPDS_Prefix;
    global $user, $sitename, $smilies, $short_user, $site_font;
    global $name, $email, $url, $bio, $user_avatar, $user_from, $user_occ, $user_intrest, $user_sig, $user_journal;
    $uname = removeHack($uname);
    $result = sql_query("SELECT uid, name, femail, url, bio, user_avatar, user_from, user_occ, user_intrest, user_sig, user_journal, mns FROM " . $NPDS_Prefix . "users WHERE uname='{$uname}'");
    list($uid, $name, $femail, $url, $bio, $user_avatar, $user_from, $user_occ, $user_intrest, $user_sig, $user_journal, $mns) = sql_fetch_row($result);
    if (!$uid) {
        header("location: index.php");
    }
    global $cookie;
    include "header.php";
    include_once "functions.php";
    $email = removeHack($femail);
    $name = stripslashes(removeHack($name));
    $url = removeHack($url);
    $bio = stripslashes(removeHack($bio));
    $user_from = stripslashes(removeHack($user_from));
    $user_occ = stripslashes(removeHack($user_occ));
    $user_intrest = stripslashes(removeHack($user_intrest));
    $user_sig = nl2br(removeHack($user_sig));
    $user_journal = stripslashes(removeHack($user_journal));
    $op = "userinfo";
    if (stristr($user_avatar, "users_private")) {
        $direktori = '';
    } else {
        global $theme;
        $direktori = "images/forum/avatar/";
        if (function_exists("theme_image")) {
            if (theme_image("forum/avatar/blank.gif")) {
                $direktori = "themes/{$theme}/images/forum/avatar/";
            }
        }
    }
    $my_rsos = array();
    $socialnetworks = array();
    $posterdata_extend = array();
    $res_id = array();
    $my_rs = '';
    if (!$short_user) {
        $posterdata_extend = get_userdata_extend_from_id($uid);
        include 'modules/reseaux-sociaux/reseaux-sociaux.conf.php';
        if ($posterdata_extend['M2'] != '') {
            $socialnetworks = explode(';', $posterdata_extend['M2']);
            foreach ($socialnetworks as $socialnetwork) {
                $res_id[] = explode('|', $socialnetwork);
            }
            sort($res_id);
            sort($rs);
            foreach ($rs as $v1) {
                foreach ($res_id as $y1) {
                    $k = array_search($y1[0], $v1);
                    if (false !== $k) {
                        $my_rs .= '<a class="mr-1" href="';
                        if ($v1[2] == 'skype') {
                            $my_rs .= $v1[1] . $y1[1] . '?chat';
                        } else {
                            $my_rs .= $v1[1] . $y1[1];
                        }
                        $my_rs .= '" target="_blank"><i class="fa fa-' . $v1[2] . ' fa-2x text-primary"></i></a> ';
                        break;
                    } else {
                        $my_rs .= '';
                    }
                }
            }
            $my_rsos[] = $my_rs;
        } else {
            $my_rsos[] = '';
        }
    }
    $posterdata = get_userdata_from_id($uid);
    $useroutils = '';
    if ($user) {
        $useroutils .= '<a class=" text-primary mr-1" href="powerpack.php?op=instant_message&amp;to_userid=' . $posterdata["uname"] . '" ><i class="fa fa-2x fa-envelope-o" title="' . translate("Send internal Message") . '" data-toggle="tooltip"></i></a>&nbsp;';
    }
    if ($posterdata['femail'] != '') {
        $useroutils .= '<a class=" text-primary mr-1" href="mailto:' . anti_spam($posterdata['femail'], 1) . '" target="_blank" ><i class="fa fa-at fa-2x" title="' . translate("Email") . '" data-toggle="tooltip"></i></a>&nbsp;';
    }
    if ($posterdata['url'] != '') {
        if (strstr('http://', $posterdata['url'])) {
            $posterdata['url'] = 'http://' . $posterdata['url'];
        }
        $useroutils .= '<a class=" text-primary mr-1" href="' . $posterdata['url'] . '" target="_blank" ><i class="fa fa-2x fa-external-link" title="' . translate("Visit this Website") . '" data-toggle="tooltip"></i></a>&nbsp;';
    }
    if ($posterdata['mns']) {
        $useroutils .= '<a class=" text-primary mr-1" href="minisite.php?op=' . $posterdata['uname'] . '" target="_blank" target="_blank" ><i class="fa fa-2x fa-desktop" title="' . translate("Visit the Mini Web Site !") . '" data-toggle="tooltip"></i></a>&nbsp;';
    }
    echo '
   <div class="row">
      <div class="col-sm-2"><img src="' . $direktori . $user_avatar . '" class=" rounded-circle center-block" /></div>
      <div class="col-sm-10">
         <h2>' . translate("User") . '&nbsp;<span class="text-muted">' . $uname . '</span></h2>';
    if ($uname !== $cookie[1]) {
        echo $useroutils;
    }
    echo $my_rsos[0];
    if ($uname == $cookie[1]) {
        //            <h3>'.translate("Welcome to").' '.$sitename.'</h3>
        echo '
         <p class="lead">' . translate("This is your personal page") . '</p>';
    }
    echo '
      </div>
   </div>
   <hr />';
    if ($uname == $cookie[1]) {
        nav($mns);
    }
    echo '
   <div class="card card-block">
      <div class="row">';
    if ($posterdata_extend['C7'] != '') {
        echo '
         <div class="col-md-6">';
    } else {
        echo '
         <div class="col-md-12">';
    }
    include "modules/sform/extend-user/aff_extend-user.php";
    echo '
         </div>';
    if ($posterdata_extend['C7'] != '') {
        $content = '';
        include 'modules/geoloc/geoloc_conf.php';
        $content .= '
<div class="col-md-6">
<div id="map_user" style="width:100%; height:400px;"></div>';
        $content .= '
<script type="text/javascript">
//<![CDATA[

   var 
   map_u, map_b,
   mapdivu = document.getElementById("map_user"),
   mapdivbl = document.getElementById("map_bloc");
   function geoloc_loaduser() {
   icon_u = {
      path: fontawesome.markers.USER,
      scale: ' . $acg_sc . ',
      strokeWeight: ' . $acg_t_ep . ',
      strokeColor: "' . $acg_t_co . '",
      strokeOpacity: ' . $acg_t_op . ',
      fillColor: "' . $acg_f_co . '",
      fillOpacity: ' . $acg_f_op . ',
   };

   icon_bl = {
      url: "' . $ch_img . $img_mbgb . '",
      size: new google.maps.Size(' . $w_ico_b . ',' . $h_ico_b . '),
      origin: new google.maps.Point(0, 0),
      anchor: new google.maps.Point(0, 0),
      scaledSize: new google.maps.Size(' . $w_ico_b . ', ' . $h_ico_b . ')
   };
      
   //==> carte du bloc
   if (document.getElementById("map_bloc")) {

      map_b = new google.maps.Map(mapdivbl,{
         center: new google.maps.LatLng(45, 0),
         zoom :3,
         zoomControl:false,
         streetViewControl:false,
         mapTypeControl: false,
         disableDoubleClickZoom: true 
      });
      map_b.setMapTypeId(google.maps.MapTypeId.' . $cartyp_b . ');
      function createMarkerB(point_b) {
         var marker_b = new google.maps.Marker({
            position: point_b,
            map: map_b,
            icon: icon_bl
         })
         return marker_b;
     }
        //== Fonction qui traite le fichier JSON ==
      $.getJSON("modules/geoloc/include/data.json", {}, function(data){
         $.each(data.markers, function(i, item){
            var point_b = new google.maps.LatLng(item.lat,item.lng);
            var marker_b = createMarkerB(point_b);
         });
      });
   };
   //<== carte du bloc
   
      map_u = new google.maps.Map(mapdivu,{
         center: new google.maps.LatLng(' . $posterdata_extend['C7'] . ', ' . $posterdata_extend['C8'] . '),
         zoom :7,
         zoomControl:true,
         streetViewControl:true,
         mapTypeControl: true,
         scrollwheel: false,
         disableDoubleClickZoom: true 
      });
      map_u.setMapTypeId(google.maps.MapTypeId.' . $cartyp_b . ');
      function createMarkerU(point_u) {
         var marker_u = new google.maps.Marker({
            position: point_u,
            map: map_u,
            title: "' . $uname . '",
            icon: icon_u
         })
         return marker_u;
      }
      var point_u = new google.maps.LatLng(' . $posterdata_extend['C7'] . ',' . $posterdata_extend['C8'] . ');
      var marker_u = createMarkerU(point_u);
   }
   $(document.body).attr("onload", "geoloc_loaduser()");
//]]>
</script>';
        $content .= '<div class="mt-1"><a href="modules.php?ModPath=geoloc&amp;ModStart=geoloc"><i class="fa fa-globe fa-lg"></i>&nbsp;[french]Carte[/french][english]Map[/english][chinese]&#x5730;&#x56FE;[/chinese]</a>';
        if ($admin) {
            $content .= '&nbsp;&nbsp;<a href="admin.php?op=Extend-Admin-SubModule&amp;ModPath=geoloc&amp;ModStart=admin/geoloc_set"><i class="fa fa-cogs fa-lg"></i>&nbsp;[french]Admin[/french] [english]Admin[/english] [chinese]Admin[/chinese]</a>';
        }
        $content .= '</div></div>';
        $content = aff_langue($content);
        echo $content;
    }
    echo '
      </div>
   </div>';
    /*   if ($uname == $cookie[1]) {
       echo '
       <div class="card text-xs-center">
          <div class="card-header">
             <img src="'.$direktori.$user_avatar.'" class="n-ava  thumbnail" />
             <p class="card-text card-title "></p>
          </div>
          <div class="card-block">
             <h3 class="card-title">'.$name.' <span class="text-muted">alias</span> '.$uname.'</h3>
             <p class="card-text">You can contact me @ '.$email.'</p>
             <p class="card-text">Don not forget to visit <a href="'.$url.'" class="oo">my web-site</a>';
       if ($mns) {echo ' OR my <a href="minisite.php?op='.$uname.'" target="_blank">'.translate("Mini-Web site").'</a>';}
       echo '
             </p>
          </div>
          <div class="card-footer text-muted">
             '.$user_sig.'
          </div>
       </div>';
       }; */
    echo '
    <br />
    <h4>' . translate("Online journal for") . ' ' . $uname . '.</h4>
    <div id="online_user_journal" class="card card-block mb-1">' . $user_journal . '</div>';
    $file = '';
    $handle = opendir('modules/comments');
    while (false !== ($file = readdir($handle))) {
        if (!preg_match('#\\.conf\\.php$#i', $file)) {
            continue;
        }
        $topic = "#topic#";
        include "modules/comments/{$file}";
        $filelist[$forum] = $url_ret;
    }
    closedir($handle);
    echo '
   <h4 class="mt-1">' . translate("Last 10 comments by") . ' ' . $uname . '.</h4>
   <div id="last_ten_comment" class="card card-block mb-1">';
    $url = '';
    $result = sql_query("SELECT topic_id, forum_id, post_text, post_time FROM " . $NPDS_Prefix . "posts WHERE forum_id<0 and poster_id='{$uid}' ORDER BY post_time DESC LIMIT 0,10");
    while (list($topic_id, $forum_id, $post_text, $post_time) = sql_fetch_row($result)) {
        $url = str_replace("#topic#", $topic_id, $filelist[$forum_id]);
        echo '<p><a href="' . $url . '">' . translate("Posted: ") . convertdate($post_time) . '</a></p>';
        $message = smilie(stripslashes($post_text));
        $message = aff_video_yt($message);
        $message = str_replace('[addsig]', '', $message);
        if (stristr($message, "<a href")) {
            $message = preg_replace('#_blank(")#i', '_blank\\1 class=\\1noir\\1', $message);
        }
        echo nl2br($message) . '<hr />';
    }
    echo '
    </div>
    <h4 class="mt-1">' . translate("Last 10 news submissions sent by") . ' ' . $uname . '.</h4>
    <div id="last_ten_comment" class="card card-block mb-1">';
    $xtab = news_aff("libre", "WHERE informant='{$uname}' ORDER BY sid DESC LIMIT 10", '', 10);
    $story_limit = 0;
    while ($story_limit < 10 and $story_limit < sizeof($xtab)) {
        list($sid, $catid, $aid, $title) = $xtab[$story_limit];
        $story_limit++;
        echo '
      <p><a href="article.php?sid=' . $sid . '">' . aff_langue($title) . '</a></p>';
    }
    echo '
   </div>
   <hr />
   <p class="n-signature">' . $user_sig . '</p>';
    include "footer.php";
}
Example #7
0
function PrintPage($oper, $DB, $nl, $sid)
{
    global $user, $cookie, $theme, $Default_Theme, $language, $site_logo, $sitename, $datetime, $nuke_url, $site_font, $Titlesitename;
    global $NPDS_Prefix;
    $aff = true;
    if ($oper == 'news') {
        $xtab = news_aff("libre", "where sid='{$sid}'", 1, 1);
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[0];
        if ($topic != '') {
            $result2 = sql_query("SELECT topictext FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'");
            list($topictext) = sql_fetch_row($result2);
        } else {
            $aff = false;
        }
    }
    if ($oper == 'archive') {
        $xtab = news_aff("archive", "WHERE sid='{$sid}'", 1, 1);
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[0];
        if ($topic != "") {
            $result2 = sql_query("SELECT topictext FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'");
            list($topictext) = sql_fetch_row($result2);
        } else {
            $aff = false;
        }
    }
    if ($oper == "links") {
        $DB = removeHack(stripslashes(htmlentities(urldecode($DB), ENT_NOQUOTES, cur_charset)));
        $result = sql_query("SELECT url, title, description, date FROM " . $DB . "links_links WHERE lid='{$sid}'");
        list($url, $title, $description, $time) = sql_fetch_row($result);
        $title = stripslashes($title);
        $description = stripslashes($description);
    }
    if ($oper == "static") {
        if (preg_match('#^[a-z0-9_\\.-]#i', $sid) and !stristr($sid, ".*://") and !stristr($sid, "..") and !stristr($sid, "../") and !stristr($sid, "script") and !stristr($sid, "cookie") and !stristr($sid, "iframe") and !stristr($sid, "applet") and !stristr($sid, "object") and !stristr($sid, "meta")) {
            if (file_exists("static/{$sid}")) {
                ob_start();
                include "static/{$sid}";
                $remp = ob_get_contents();
                ob_end_clean();
                if ($DB) {
                    $remp = meta_lang(aff_code(aff_langue($remp)));
                }
                if ($nl) {
                    $remp = nl2br(str_replace(" ", "&nbsp;", htmlentities($remp, ENT_QUOTES, cur_charset)));
                }
                $title = $sid;
            } else {
                $aff = false;
            }
        } else {
            $remp = "<p align=\"center\" class=\"rouge\">" . translate("Please enter information according to the specifications") . "</p><br />";
            $aff = false;
        }
    }
    if ($aff == true) {
        $Titlesitename = "NPDS - " . translate("Printer Friendly Page") . " / " . $title;
        if (isset($time)) {
            formatTimestamp($time);
        }
        include "meta/meta.php";
        if (isset($user)) {
            if ($cookie[9] == "") {
                $cookie[9] = $Default_Theme;
            }
            if (isset($theme)) {
                $cookie[9] = $theme;
            }
            $tmp_theme = $cookie[9];
            if (!($file = @opendir("themes/{$cookie['9']}"))) {
                $tmp_theme = $Default_Theme;
            }
        } else {
            $tmp_theme = $Default_Theme;
        }
        echo import_css($tmp_theme, $language, $site_font, "", "");
        echo "\n       </head>\n       <body style=\"background-color: #FFFFFF; background-image: none;\">\n       <table border=\"0\"><tr><td>\n       <table border=\"0\" width=\"640\" cellpadding=\"0\" cellspacing=\"1\" style=\"background-color: #000000;\"><tr><td>\n       <table border=\"0\" width=\"640\" cellpadding=\"20\" cellspacing=\"1\" style=\"background-color: #FFFFFF;\"><tr><td>";
        echo "<p align=\"center\">";
        $pos = strpos($site_logo, "/");
        if ($pos) {
            echo "<img src=\"{$site_logo}\" border=\"0\" alt=\"\" />";
        } else {
            echo "<img src=\"images/{$site_logo}\" border=\"0\" alt=\"\" />";
        }
        echo "<br /><br /><b>" . aff_langue($title) . "</b><br /><br />";
        if ($oper == "news" or $oper == "archive") {
            $hometext = meta_lang(aff_code(aff_langue($hometext)));
            $bodytext = meta_lang(aff_code(aff_langue($bodytext)));
            echo "<span style=\"font-size: 10px;\"><b>" . translate("Date:") . "</b> {$datetime} :: <b>" . translate("Topic:") . "</b> " . aff_langue($topictext) . "<br /><br />\n          </span></p>{$hometext}<br /><br />";
            if ($bodytext != '') {
                echo "{$bodytext}<br /><br />";
            }
            echo meta_lang(aff_code(aff_langue($notes)));
            if ($oper == "news") {
                echo "</td></tr><tr><td><br /><br /><br /><hr noshade=\"noshade\" class=\"ongl\" /><br />\n             <p align=\"center\">" . translate("This article comes from") . " {$sitename}<br /><br />\n             " . translate("The URL for this story is:") . "\n             <a href=\"{$nuke_url}/article.php?sid={$sid}\">{$nuke_url}/article.php?sid={$sid}</a></p>";
            } else {
                echo "</td></tr><tr><td><br /><br /><br /><hr noshade=\"noshade\" class=\"ongl\" /><br />\n             <p align=\"center\">" . translate("This article comes from") . " {$sitename}<br /><br />\n             " . translate("The URL for this story is:") . "\n             <a href=\"{$nuke_url}/article.php?sid={$sid}&amp;archive=1\">{$nuke_url}/article.php?sid={$sid}&amp;archive=1</a></p>";
            }
        }
        if ($oper == "links") {
            echo "<span style=\"font-size: 10px;\"><b>" . translate("Date:") . "</b> {$datetime}";
            if ($url != "") {
                echo " :: <b>" . translate("Links") . " : </b> {$url}<br /><br />";
            }
            echo "</span></p>" . aff_langue($description);
            echo "</td></tr><tr><td><br /><br /><br /><hr noshade=\"noshade\" class=\"ongl\" /><br />\n          <p align=\"center\">" . translate("This article comes from") . " {$sitename}<br /><br />\n          <a href=\"{$nuke_url}\">{$nuke_url}</a></p>";
        }
        if ($oper == "static") {
            echo "</p><span style=\"font-size: 10px;\">" . $remp . "</span>";
            echo "</td></tr><tr><td><br /><br /><br /><hr noshade=\"noshade\" class=\"ongl\" /><br />\n          <p align=\"center\">" . translate("This article comes from") . " {$sitename}<br /><br />\n          <a href=\"{$nuke_url}/static.php?op={$sid}&npds=1\">{$nuke_url}/static.php?op={$sid}&npds=1</a></p>";
        }
        echo "</td></tr></table></td></tr></table></td></tr></table></body></html>";
    } else {
        header("location: index.php");
    }
}
Example #8
0
function PrintPage($oper, $DB, $nl, $sid)
{
    global $user, $cookie, $theme, $Default_Theme, $language, $site_logo, $sitename, $datetime, $nuke_url, $site_font, $Titlesitename;
    global $NPDS_Prefix;
    $aff = true;
    if ($oper == 'news') {
        $xtab = news_aff('libre', "where sid='{$sid}'", 1, 1);
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[0];
        if ($topic != '') {
            $result2 = sql_query("SELECT topictext FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'");
            list($topictext) = sql_fetch_row($result2);
        } else {
            $aff = false;
        }
    }
    if ($oper == 'archive') {
        $xtab = news_aff('archive', "WHERE sid='{$sid}'", 1, 1);
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[0];
        if ($topic != '') {
            $result2 = sql_query("SELECT topictext FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'");
            list($topictext) = sql_fetch_row($result2);
        } else {
            $aff = false;
        }
    }
    if ($oper == 'links') {
        $DB = removeHack(stripslashes(htmlentities(urldecode($DB), ENT_NOQUOTES, cur_charset)));
        $result = sql_query("SELECT url, title, description, date FROM " . $DB . "links_links WHERE lid='{$sid}'");
        list($url, $title, $description, $time) = sql_fetch_row($result);
        $title = stripslashes($title);
        $description = stripslashes($description);
    }
    if ($oper == 'static') {
        if (preg_match('#^[a-z0-9_\\.-]#i', $sid) and !stristr($sid, ".*://") and !stristr($sid, "..") and !stristr($sid, "../") and !stristr($sid, 'script') and !stristr($sid, "cookie") and !stristr($sid, 'iframe') and !stristr($sid, 'applet') and !stristr($sid, 'object') and !stristr($sid, 'meta')) {
            if (file_exists("static/{$sid}")) {
                ob_start();
                include "static/{$sid}";
                $remp = ob_get_contents();
                ob_end_clean();
                if ($DB) {
                    $remp = meta_lang(aff_code(aff_langue($remp)));
                }
                if ($nl) {
                    $remp = nl2br(str_replace(' ', '&nbsp;', htmlentities($remp, ENT_QUOTES, cur_charset)));
                }
                $title = $sid;
            } else {
                $aff = false;
            }
        } else {
            $remp = '<div class="alert alert-danger">' . translate("Please enter information according to the specifications") . '</div>';
            $aff = false;
        }
    }
    if ($aff == true) {
        $Titlesitename = 'NPDS - ' . translate("Printer Friendly Page") . ' / ' . $title;
        if (isset($time)) {
            formatTimestamp($time);
        }
        include "meta/meta.php";
        if (isset($user)) {
            if ($cookie[9] == '') {
                $cookie[9] = $Default_Theme;
            }
            if (isset($theme)) {
                $cookie[9] = $theme;
            }
            $tmp_theme = $cookie[9];
            if (!($file = @opendir("themes/{$cookie['9']}"))) {
                $tmp_theme = $Default_Theme;
            }
        } else {
            $tmp_theme = $Default_Theme;
        }
        echo '
         <link rel="stylesheet" href="lib/bootstrap/dist/css/bootstrap.min.css" />';
        echo import_css($tmp_theme, $language, $site_font, '', '');
        echo '
       </head>
       <body>
          <div max-width="640" class="container p-1 n-hyphenate">
             <div>';
        $pos = strpos($site_logo, '/');
        if ($pos) {
            echo '<img class="img-fluid d-block mx-auto" src="' . $site_logo . '" alt="website logo" />';
        } else {
            echo '<img class="img-fluid d-block mx-auto" src="images/' . $site_logo . '" alt="website logo" />';
        }
        echo '
               <h1 class="d-block text-xs-center my-2">' . aff_langue($title) . '</h1>';
        if ($oper == 'news' or $oper == 'archive') {
            $hometext = meta_lang(aff_code(aff_langue($hometext)));
            $bodytext = meta_lang(aff_code(aff_langue($bodytext)));
            echo '
             <span class="float-xs-right text-capitalize" style="font-size: .8rem;"> ' . $datetime . '</span><br />
             <hr />
             <h2 class="mb-1">' . translate("Topic:") . ' ' . aff_langue($topictext) . '</h2>
         </div>
         <div>' . $hometext . '<br /><br />';
            if ($bodytext != '') {
                echo $bodytext . '<br /><br />';
            }
            echo meta_lang(aff_code(aff_langue($notes)));
            echo '
          </div>';
            if ($oper == 'news') {
                echo '
             <hr />
             <p class="text-xs-center">' . translate("This article comes from") . ' ' . $sitename . '<br />
             ' . translate("The URL for this story is:") . '
             <a href="' . $nuke_url . '/article.php?sid=' . $sid . '">' . $nuke_url . '/article.php?sid=' . $sid . '</a>
             </p>';
            } else {
                echo '
             <hr />
             <p class="text-xs-center">' . translate("This article comes from") . ' ' . $sitename . '<br />
             ' . translate("The URL for this story is:") . '
             <a href="' . $nuke_url . '/article.php?sid=' . $sid . '&amp;archive=1">' . $nuke_url . '/article.php?sid=' . $sid . '&amp;archive=1</a>
             </p>';
            }
        }
        if ($oper == 'links') {
            echo '<span class="float-xs-right text-capitalize" style="font-size: .8rem;">' . $datetime . '</span><br /><hr />';
            if ($url != '') {
                echo '<h2 class="mb-1">' . translate("Links") . ' : ' . $url . '</h2>';
            }
            echo '
          <div>' . aff_langue($description) . '</div>
          <hr />
          <p class="text-xs-center">' . translate("This article comes from") . ' ' . $sitename . '<br />
          <a href="' . $nuke_url . '">' . $nuke_url . '</a></p>';
        }
        if ($oper == 'static') {
            echo '
          <div>
             ' . $remp . '
          </div>
          <hr />
          <p class="text-xs-center">' . translate("This article comes from") . ' ' . $sitename . '<br />
          <a href="' . $nuke_url . '/static.php?op=' . $sid . '&npds=1">' . $nuke_url . '/static.php?op=' . $sid . '&npds=1</a></p>';
        }
        echo '
      </div>
   </body>
</html>';
    } else {
        header("location: index.php");
    }
}