File: /home/asjudine/public_html/page.php
<?php
$index = 1;
require_once("mainfile.php");
function theindex() {
global $dbi, $storyhome, $httpref, $httprefmax, $topicname, $topicimage, $topictext, $datetime, $user, $cookie, $nukeurl, $prefix, $multilingual, $currentlang, $articlecomm;
if ($multilingual == 1) {
$querylang = "AND (alanguage='$currentlang' OR alanguage='')";
} else {
$querylang = "";
}
include("header.php");
automated_news();
message_box();
if ($save AND is_user($user)) {
cookiedecode($user);
sql_query("update $user_prefix"._users." set umode='$mode', uorder='$order', thold='$thold' where uid='$cookie[0]'", $dbi);
getusrinfo($user);
$info = base64_encode("$userinfo[uid]:$userinfo[uname]:$userinfo[pass]:$userinfo[storynum]:$userinfo[umode]:$userinfo[uorder]:$userinfo[thold]:$userinfo[noscore]");
setcookie("user","$info",time()+$cookieusrtime);
}
if ($op == "Reply") {
Header("Location: comments.php?op=Reply&pid=0&sid=$sid&mode=$mode&order=$order&thold=$thold");
}
$result = sql_query("select catid, aid, time, title, hometext, bodytext, topic, informant, notes, haspoll, pollID FROM $prefix"._stories." where sid=$sid", $dbi);
list($catid, $aid, $time, $title, $hometext, $bodytext, $topic, $informant, $notes, $haspoll, $pollID) = sql_fetch_row($result, $dbi);
sql_query("UPDATE $prefix"._stories." SET counter=counter+1 where sid=$sid", $dbi);
$artpage = 1;
$pagetitle = "- $title";
require("header.php");
$artpage = 0;
formatTimestamp($time);
$title = stripslashes($title);
$hometext = stripslashes($hometext);
$bodytext = stripslashes($bodytext);
$notes = stripslashes($notes);
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>";
} else {
$notes = "";
}
if($bodytext == "") {
$bodytext = "$hometext$notes";
} else {
$bodytext = "$hometext<br><br>$bodytext$notes";
}
if($informant == "") {
$informant = $anonymous;
}
getTopics($sid);
if ($catid != 0) {
$resultx = sql_query("select title from $prefix"._stories."_cat where catid='$catid'", $dbi);
list($title1) = sql_fetch_row($resultx, $dbi);
$title = "<a href=\"categories.php?op=newindex&catid=$catid\"><font class=\"storycat\">$title1</font></a>: $title";
}
echo "<br><table width=\"100%\" border=\"0\"><tr><td valign=\"top\" width=\"100%\">\n";
themearticle($aid, $informant, $datetime, $title, $bodytext, $topic, $topicname, $topicimage, $topictext);
echo "<br><br></td><td> </td><td valign=\"top\" bgcolor=#ffffff>\n";
if ($multilingual == 1) {
$querylang = "AND (blanguage='$currentlang' OR blanguage='')";
} else {
$querylang = "";
}
/* Determine if the article has attached a poll */
if ($haspoll == 1) {
$url = sprintf("pollBooth.php?op=results&pollID=%d", $pollID);
$boxContent = "<form action=\"pollBooth.php\" method=\"post\">";
$boxContent .= "<input type=\"hidden\" name=\"pollID\" value=\"".$pollID."\">";
$boxContent .= "<input type=\"hidden\" name=\"forwarder\" value=\"".$url."\">";
$result = sql_query("SELECT pollTitle, voters FROM $prefix"._poll_desc." WHERE pollID=$pollID", $dbi);
list($pollTitle, $voters) = sql_fetch_row($result, $dbi);
$boxTitle = _ARTICLEPOLL;
$boxContent .= "<font class=\"content\"><b>$pollTitle</b></font><br><br>\n";
$boxContent .= "<table border=\"0\" width=\"100%\">";
for($i = 1; $i <= 12; $i++) {
$result = sql_query("SELECT pollID, optionText, optionCount, voteID FROM $prefix"._poll_data." WHERE (pollID=$pollID) AND (voteID=$i)", $dbi);
$object = sql_fetch_object($result, $dbi);
if(is_object($object)) {
$optionText = $object->optionText;
if($optionText != "") {
$boxContent .= "<tr><td valign=\"top\"><input type=\"radio\" name=\"voteID\" value=\"".$i."\"></td><td width=\"100%\"><font class=\"content\">$optionText</font></td></tr>\n";
}
}
}
$boxContent .= "</table><br><center><font class=\"content\"><input type=\"submit\" value=\""._VOTE."\"></font><br>";
if (is_user($user)) {
cookiedecode($user);
}
for($i = 0; $i < 12; $i++) {
$result = sql_query("SELECT optionCount FROM $prefix"._poll_data." WHERE (pollID=$pollID) AND (voteID=$i)", $dbi);
$object = sql_fetch_object($result, $dbi);
$optionCount = $object->optionCount;
$sum = (int)$sum+$optionCount;
}
$boxContent .= "<font class=\"content\">[ <a href=\"pollBooth.php?op=results&pollID=$pollID&mode=$cookie[4]&order=$cookie[5]&thold=$cookie[6]\"><b>"._RESULTS."</b></a> | <a href=\"pollBooth.php\"><b>"._POLLS."</b></a> ]<br>";
if ($pollcomm) {
list($numcom) = sql_fetch_row(sql_query("select count(*) from $prefix"._pollcomments." where pollID=$pollID", $dbi), $dbi);
$boxContent .= "<br>"._VOTES.": <b>$sum</b> | "._PCOMMENTS." <b>$numcom</b>\n\n";
} else {
$boxContent .= "<br>"._VOTES." <b>$sum</b>\n\n";
}
$boxContent .= "</font></center></form>\n\n";
themesidebox($boxTitle, $boxContent);
}
$result = sql_query("select title, content, active, position from $prefix"._blocks." where bkey='login' $querylang", $dbi);
list($title, $content, $active, $position) = sql_fetch_row($result, $dbi);
if (($active == 1) AND ($position == "r") AND (!is_user($user))) {
loginbox();
}
$boxtitle = "<b><font color=#009933>"._RELATED."</font></b>";
$boxstuff = "<font class=\"content\">";
$result = sql_query("select name, url from $prefix"._related." where tid=$topic", $dbi);
while(list($name, $url) = sql_fetch_row($result, $dbi)) {
$boxstuff .= "<strong><big>-</big></strong> <a href=\"$url\" target=\"new\"><font class=\"tiny\">$name</font></a>\n";
}
$boxstuff .= "<strong><big>·</big></strong> <a href=\"search.php?topic=$topic\"><font class=\"tiny\"><b>"._MOREABOUT."</b> $topictext</a></font><br>\n";
$boxstuff .= "<strong><big>·</big></strong> <a href=\"search.php?author=$aid\"><font class=\"tiny\">"._NEWSBY." $aid</font></a><br>\n";
/* This is a list for automatic related links on article internal page */
/* For this I used a multi-dimensional array so we can show the links titles */
/* as we want, doesn't matter the case of the string in the article. You can */
/* add or remove links from this array as you wish to fit your needs */
$relatedarray = array ("gpl" => array ("GPL" => "http://www.gnu.org"),
"linux" => array ("Linux.com" => "http://www.linux.com"),
"blender" => array ("Blender" => "http://www.blender.nl"),
"gnu" => array ("GNU Project" => "http://www.gnu.org"),
"gimp" => array ("The GIMP" => "http://www.gimp.org"),
"cnn" => array ("CNN.com" => "http://www.cnn.com"),
"news.com" => array ("News.com" => "http://www.news.com"),
"ibm" => array ("IBM" => "http://www.ibm.com"),
"php" => array ("PHP HomePage" => "http://www.php.net"),
"mandrake" => array ("MandrakeSoft" => "http://www.mandrakesoft.com"),
"redhat" => array ("Red Hat" => "http://www.redhat.com"),
"red hat" => array ("Red Hat" => "http://www.redhat.com"),
"Debian" => array ("Debian GNU/Linux" => "http://www.debian.org"),
"Slackware" => array ("Slackware" => "http://www.slackware.com"),
"freebsd" => array ("FreeBSD" => "http://www.freebsd.org"),
"artist" => array ("Linux Artist" => "http://www.linuxartist.com"),
"games" => array ("Linux Games" => "http://www.linuxgames.com"),
"sourceforge" => array ("SourceForge" => "http://www.sourceforge.net"),
"source forge" => array ("SourceForge" => "http://www.sourceforge.net"),
"palm pilot" => array ("Palm Pilot" => "http://www.palm.com"),
"windows" => array ("Microsoft" => "http://www.microsoft.com"),
"microsoft" => array ("Microsoft" => "http://www.microsoft.com"),
"kernel" => array ("Linux Kernel Archives" => "http://www.kernel.org"),
"opensource" => array ("OpenSource" => "http://www.opensource.org"),
"open source" => array ("OpenSource" => "http://www.opensource.org"),
"nuke" => array ("PHP-Nuke" => "http://www.phpnuke.org"),
"compaq" => array ("Compaq" => "http://www.compaq.com"),
"intel" => array ("Intel" => "http://www.intel.com"),
"mysql" => array ("MySQL Database Server" => "http://www.mysql.com"),
"themes" => array ("Themes.org" => "http://www.themes.org"),
"suse" => array ("SuSE" => "http://www.suse.com"),
"script" => array ("HotScripts" => "http://www.hotscripts.com"),
"transmeta" => array ("Transmeta" => "http://www.transmeta.com"),
"apple" => array ("Apple" => "http://www.apple.com"),
"apache" => array ("Apache Web Server" => "http://www.apache.org"),
"nasa" => array ("NASA" => "http://www.nasa.gov"),
"documentation" => array ("Linux Manuals" => "http://www.linuxdoc.org"),
"manual" => array ("Linux Manuals" => "http://www.linuxdoc.org"),
"howto" => array ("Linux Manuals" => "http://www.linuxdoc.org"),
"rtfm" => array ("Linux Manuals" => "http://www.linuxdoc.org"),
"dell" => array ("Dell" => "http://www.dell.com"),
"google" => array ("Google Search Engine" => "http://www.google.com"),
"translat" => array ("Babelfish Translator" => "http://babelfish.altavista.com"),
"w3" => array ("W3 Consortium" => "http://www.w3.org"),
"css" => array ("CSS Standard" => "http://www.w3.org/Style/CSS"),
" html" => array ("HTML Standard" => "http://www.w3.org/MarkUp"),
"xhmtl" => array ("XHTML Standard" => "http://www.w3.org/MarkUp"),
"rpm" => array ("RPM" => "http://www.rpm.org"),
"3com" => array ("3Com" => "http://www.3com.com"),
"sun microsyste" => array ("Sun Microsystems" => "http://www.sun.com"),
"staroffice" => array ("Star Office" => "http://www.sun.com"),
"star office" => array ("Star Office" => "http://www.sun.com"),
"openoffice" => array ("Open Office" => "http://www.openoffice.org"),
"open office" => array ("Open Office" => "http://www.openoffice.org"),
"oracle" => array ("Oracle" => "http://www.oracle.com"),
"informix" => array ("Informix" => "http://www.informix.com"),
"postgre" => array ("PostgreSQL" => "http://www.postgresql.org"),
"mp3" => array ("MP3.com" => "http://www.mp3.com"),
"gnome" => array ("GNOME" => "http://www.gnome.org"),
"kde" => array ("KDE" => "http://www.kde.org"),
"mozilla" => array ("Mozilla" => "http://www.mozilla.org"),
"netscape" => array ("Netscape" => "http://www.netscape.com"),
"corel" => array ("Corel" => "http://www.corel.com"),
" hp" => array ("Hewlett Packard" => "http://www.hp.com"),
"hewlett packar" => array ("Hewlett Packard" => "http://www.hp.com"),
"caldera" => array ("Caldera Systems" => "http://www.caldera.com"),
"freshmeat" => array ("Freshmeat" => "http://www.freshmeat.net"),
"slashdot" => array ("Slashdot" => "http://www.slashdot.org"),
"spam" => array ("Spam Cop" => "http://www.spamcop.net"),
"aol" => array ("America Online" => "http://www.aol.com"),
"america online" => array ("America Online" => "http://www.aol.com"),
"pov-ray" => array ("POV Ray" => "http://www.povray.org"),
"povray" => array ("POV Ray" => "http://www.povray.org"),
"pov ray" => array ("POV Ray" => "http://www.povray.org"),
"seti" => array ("SETI Institute" => "http://www.seti.org"),
"cnet" => array ("C|Net News" => "http://www.cnet.com"),
"zdnet" => array ("ZDNet News" => "http://www.zdnet.com"),
"napster" => array ("Napster" => "http://www.napster.com"),
"sony" => array ("Sony HomePage" => "http://www.sony.com"),
"xfree" => array ("X-Free86 Project" => "http://www.xfree.org"),
"x-free" => array ("X-Free86 Project" => "http://www.xfree.org"),
"x free" => array ("X-Free86 Project" => "http://www.xfree.org"),
"beos" => array ("BeOS" => "http://www.beos.com"),
"borland" => array ("Borland" => "http://www.borland.com"),
"kylix" => array ("Kylix HomePage" => "http://www.borland.com/kylix"),
"amazon" => array ("Amazon.com" => "http://www.amazon.com")
);
while (list ($key) = each ($relatedarray)) {
$relarr = eregi($key, $bodytext);
if ($relarr) {
list($rep, $val) = each ($relatedarray[$key]);
$boxstuff .= "<strong><big>·</big></strong> <a href=\"$val\" target=\"new\">$rep</a><br>\n";
}
}
/* Multi-dimensional array end here */
$boxstuff .= "</font>";
global $multilingual, $currentlang;
if ($multilingual == 1) {
$querylang = "AND (alanguage='$currentlang' OR alanguage='')"; /* the OR is needed to display stories who are posted to ALL languages */
} else {
$querylang = "";
}
$result2 = sql_query("select sid, title, acomm from $prefix"._stories." where topic=$topic $querylang order by counter desc limit 0,1", $dbi);
list($topstory, $ttitle, $acomm) = sql_fetch_row($result2, $dbi);
$boxstuff .= "</font></center>\n";
themesidebox($boxtitle, $boxstuff);
$optiontitle = "<b><font color=#009933>"._OPTIONS."</font></b>";
$optionbox .= "<strong><big>·</big></strong> <a href=\"print.php?sid=$sid\"><font class=\"tiny\">"._PRINTER."</font></a><br>";
$optionbox .= "<strong><big>·</big></strong> <a href=\"friend.php?op=FriendSend&sid=$sid\"><font class=\"tiny\">"._FRIEND."</font></a>\n";
if (is_admin($admin)) {
$optionbox .= "<br><center><br><b><font color=#009933>"._ADMIN."</font></b><br><a href=\"admin.php?op=adminStory\"><font class=\"tiny\">"._ADD."</font></a><br><a href=\"admin.php?op=EditStory&sid=$sid\"><font class=\"tiny\">"._EDIT."</font></a><br><a href=\"admin.php?op=RemoveStory&sid=$sid\"><font class=\"tiny\">"._DELETE."</font></a></font></center>";
}
themesidebox($optiontitle, $optionbox);
echo "</td></tr></table>\n";
cookiedecode($user);
if ((($mode != "nocomments") OR ($acomm == 0)) AND ($articlecomm == 1)) {
include("comments.php");
}
include("footer.php");
}
function theindex2() {
include("header.php");
echo "<table width=\"620\" border=\"0\" cellspacing=\"0\">
<tr valign=\"top\">
<td height=\"282\" width=\"621\">
<div align=\"center\">
<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\" bordercolor=\"#CCCCCC\" align=\"left\" height=\"278\">
<tr>
<td>
<div align=\"center\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"300\" height=\"90\">
<param name=movie value=\"themes/Febor/images/carrito.swf\">
<param name=quality value=high>
<embed src=\"themes/Febor/images/carrito.swf\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"300\" height=\"90\">
</embed>
</object></div>
</td>
</tr>
<tr>
<td>
<p><font face=\"Arial, Helvetica, sans-serif\" size=\"1\"><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><img src=\"themes/Febor/images/fachadalmacen.gif\" width=\"200\" height=\"108\" align=\"right\">El
tamaño y diseño de nuestros puntos de venta
nos permite ofrecerle atención más ágil
y personalizada, sin las congestiones y filas usuales en
los hipermercados.</font></font></p>
<p><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">Para
su comodidad, contamos con 19 <a href=\"puntos.htm\">almacenes
y droguerías </a> ubicados en diferentes zonas de
Bogotá, ciudad en la cual somos pioneros en la actividad
de mercadeo, pues llevamos 51 años protegiendo el
costo de la canasta familiar.<br>
</font></p>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width=\"621\" valign=\"top\" align=\"left\">
<div align=\"left\"></div>
<table width=\"589\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td width=\"38%\" valign=\"top\" height=\"217\">
<table width=\"76%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"211\">
<tr>
<td align=\"left\">
<table width=\"216\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\" height=\"20\">
<tr>
<td bgcolor=\"#CCCCCC\">
<div align=\"center\"><font size=\"2\" color=\"#FFFFFF\"><b><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#009933\">Febrero
mes de las frutas</font></b></font></div>
</td>
</tr>
</table>
<table width=\"218\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\" height=\"170\" bordercolor=\"#CCCCCC\">
<tr>
<td valign=\"top\" align=\"center\" height=\"180\">
<div align=\"center\">
<p align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\"><img src=\"themes/Febor/images/frutas.gif\" width=\"176\" height=\"128\"><br>
<font color=\"#000000\" size=\"1\">Presente su tarjeta
supercliente y durante todo el mes de febrero
obtenga un <font color=\"#FF0000\">30%</font>
de descuento en frutas.</font></font></p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width=\"62%\" align=\"left\" valign=\"top\" height=\"217\">
<table width=\"352\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\" height=\"20\">
<tr>
<td bgcolor=\"#CCCCCC\">
<div align=\"center\"><font size=\"2\" color=\"#FFFFFF\"><b><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#009933\">Conoce
nuestro nuevo servicio a domicilio?</font></b></font></div>
</td>
</tr>
</table>
<table width=\"352\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\" height=\"189\" bordercolor=\"#CCCCCC\">
<tr>
<td valign=\"top\" align=\"center\" height=\"188\">
<div align=\"center\">
<p align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\"><img src=\"themes/Febor/images/bannerdomicilios.gif\" width=\"224\" height=\"85\"><br>
<font color=\"#000000\" size=\"1\">Haga su pedido telefónicamente
y reciba sus productos a los mismos precios que ofrecemos
en nuestros puntos de venta.<br>
Llámenos, indíquenos su direccción
y en pocos minutos le enviaremos su pedido desde el
almacén o droguería más cercano
a su residencia.</font></font></p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>";
include("footer.php");
}
if ($file != "") {
$index = 0;
include("header.php");
OpenTable();
$file2 = substr($file,0,2);
if (ereg("\.\.", $file2)) {
$file = ereg_replace("\.\.", "", $file);
}
$file2 = substr($file,0,1);
if ($file2 == "/") {
$file = ereg_replace("/", "", $file);
}
if (!@file($file) OR (eregi("\.\.",$file))) {
echo "<center><font class=\"title\">$sitename</font><br><br>"
."<font class=\"content\">"._FILENOTEXIST."</font><br><br>"
.""._GOBACK."</center>";
} else {
include("counter.php");
include("$file");
}
CloseTable();
include("footer.php");
die();
}
switch ($op) {
default:
theindex();
}
?>