Filter:   InfoImg
download sections.php
Language: PHP
LOC: 113
Project Info
Free Market(freemarket)
Server: SourceForge
Type: cvs
...\freemarket\freemarket\www\
   .htaccess
   admin.php
   article.php
   auth.inc.php
   backend.php
   banners.php
   comments.php
   counter.php
   dhtmllib.js
   download.php
   ezhilit.php
   faq.php
   footer.php
   friend.php
   header.php
   index.php
   lang-croatian.php
   lang-danish.php
   lang-dutch.php
   lang-english.php
   lang-french.php
   lang-german.php
   lang-indonesia.php
   lang-indonesian.php
   lang-italian.php
   lang-japanese.php
   lang-korean.php
   lang-latvian.php
   lang-norwegian.php
   lang-polish.php
   lang-portuguese.php
   lang-quebec.php
   lang-russian.php
   lang-simplifiedchinese.php
   lang-slovak.php
   lang-spanish.php
   lang-swedish.php
   lang-TEMPLATE.php
   ...-traditionalchinese.php
   links.php
   mainfile.php
   memberlist.php
   memberslist.php
   pollBooth.php
   pollcomments.php
   postinfo.html
   print.php
   problems.php
   scroller.js
   search.php
   sections.php
   stats.php
   submit.php
   top.php
   topics.php
   user.php

<?PHP

######################################################################
# PHP-NUKE: Web Portal System
# ===========================
#
# Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve)
# http://phpnuke.org
#
# This modules is to have special sections for articles, reviews, etc.
#
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License.
######################################################################

if(!isset($mainfile)) { include("mainfile.php"); }

function listsections() {
	include ('header.php');
	
	$result = mysql_query("select secid, secname, image from sections order by secname");
	echo "<center>
	<table width=100% border=0 cellspacing=1 cellpadding=0 bgcolor=000000><tr><td>
	<table width=100% border=0 cellspacing=1 cellpadding=8 bgcolor=FFFFFF><tr><td>
	<center>
	"."Available Sections"."<br><br>
	<br><br>
	<table border=0>";
	$count = 0;
	while (list($secid, $secname, $image) = mysql_fetch_row($result)) {
	    if ($count==2) {
		echo "<tr>";
		$count = 0;
	    }
	    echo "<td><a href=sections.php?op=listarticles&secid=$secid>$secname</a>";
	    $count++;
	    if ($count==2) {
		echo "</tr>";
	    }
	    echo "</td>";
	}
	mysql_free_result($result);
	echo "</table></center></td></tr></table></td></tr></table>";
	include ('footer.php');
}

function listarticles($secid) {
	include ('header.php');
	$result = mysql_query("select secname from sections where secid=$secid");
	list($secname) = mysql_fetch_row($result);
	mysql_free_result($result);
	$result = mysql_query("select artid, secid, title, content, counter from seccont where secid=$secid");
	echo "<center>
	<table width=100% border=0 cellspacing=1 cellpadding=0 bgcolor=000000><tr><td>
	<table width=100% border=0 cellspacing=1 cellpadding=8 bgcolor=FFFFFF><tr><td>";
	$result2 = mysql_query("select image from sections where secid=$secid");
	list($image) = mysql_fetch_row($result2);
	echo "<center>
	<font size=3>
	<b>$secname</b><br>
	<br><br>
	<table border=0>";
	while (list($artid, $secid, $title, $content, $counter) = mysql_fetch_row($result)) {
	    echo "
	    <tr><td align=left><font size=2>
	    <li><a href=sections.php?op=viewarticle&artid=$artid>$title</a> (".translate("read:")." $counter ".translate("times").")
	    </td></tr>
	    ";	
	}
	echo "</table>
	<br><br><br>
	[ <a href=sections.php>".translate("Return to Sections Index")."</a> ]
	</center>
	</td></tr></table></td></tr></table>";
	mysql_free_result($result);
	include ('footer.php');
}

function viewarticle($artid) {
	include("header.php");
	mysql_query("update seccont set counter=counter+1 where artid='$artid'");
	
	$result = mysql_query("select artid, secid, title, content, counter from seccont where artid=$artid");
	list($artid, $secid, $title, $content, $counter) = mysql_fetch_row($result);
		
	$result2 = mysql_query("select secid, secname from sections where secid=$secid");
	list($secid, $secname) = mysql_fetch_row($result2);
	$words = sizeof(explode(" ", $content));
	
	echo "<center>
	<table border=0 cellpadding=1 cellspacing=1 width=100% bgcolor=000000><tr><td>
	<table border=0 cellpadding=8 cellspacing=1 width=100% bgcolor=FFFFFF>
	<tr><td align=left><font size=3>
	<b>$title</b><br>
	<font size=2>
	($words ".translate("total words in this text)")."<br>
	(".translate("read:")." $counter ".translate("times").")<br><br>
	<br><br>
	$content
	</td></tr>
	<tr><td align=center>
	[ <a href=sections.php?op=listarticles&secid=$secid>".translate("Back to")." $secname</a> |
	<a href=sections.php>".translate("Sections Index")."</a> ]
	</td></tr>
	</table></td></tr></table></center>";
	mysql_free_result($result);
	mysql_free_result($result2);
	include ('footer.php');
}



switch($op) {

    case "viewarticle":
	viewarticle($artid);
	break;

    case "listarticles":
	listarticles($secid);
	break;
		
    default:
	listsections();
	break;

}
?>