<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- Kategorije članaka";
$index = 0;
function listsections() {
global $sitename, $prefix, $dbi, $module_name;
include ('header.php');
$result = sql_query("select secid, secname, image from ".$prefix."_sections order by secname", $dbi);
OpenTable();
echo"<table>"
. " <tr>"
. " <td>"._SECWELCOME."</td>"
. " </tr>"
. "</table>"
."";
echo "
<table>"
. " <tr>"
. " <td>"
. " <img></td>"
. " </tr>"
. "</table>
<table>";
$count = 0;
while (list($secid, $secname, $image) = sql_fetch_row($result, $dbi)) {
if ($count==2) {
echo "<tr>";
$count = 0;
}
if ($image== "") {echo "<td> <img> <b><a>$secname</a></b> ";}
else { echo "<td><a><img></a> <a>$secname</a>";};
$count++;
if ($count==3) {
echo "</tr>";
}
echo "</td>";
}
echo "</table><br><Table><tr><td><table>"
. " <tr>"
. " <td>"
. " <img></td>"
. " </tr>"
. "</table>[ <a>promocija putem: PromoWebServis.com</a> ]</td></tr></table></center>";
CloseTable();
include ('footer.php');
}
function listarticles($secid) {
global $prefix, $multilingual, $currentlang, $dbi, $module_name;
if ($multilingual == 1) {
$querylang = "AND slanguage='$currentlang'";
} else {
$querylang = "";
}
include ('header.php');
$result = sql_query("select secname from ".$prefix."_sections where secid=$secid", $dbi);
list($secname) = sql_fetch_row($result, $dbi);
$result = sql_query("select artid, secid, title, content, counter from ".$prefix."_seccont where secid=$secid $querylang ORDER BY artid DESC", $dbi);;
OpenTable();
$result2 = sql_query("select image from ".$prefix."_sections where secid=$secid", $dbi);
list($image) = sql_fetch_row($result2, $dbi);
echo"<table>"
. " <tr>"
. " <td>"
. " <img></td>"
. " </tr>"
. "</table>"
."";
echo "<left>"; if ($image== "") {echo " <b>$secname</b> ";}
else { echo"<table>"
. " <tr>"
. " <td>Nalazim se u kategoriji: <a>$secname</a>.</td>"
. " </tr>"
. "</table>"
."";};
echo"<table>"
. " <tr>"
. " <td>"
. " <img></td>"
. " </tr>"
. "</table>"
."";
echo"
<font>
<table>";
while (list($artid, $secid, $title, $content, $counter) = sql_fetch_row($result, $dbi)) {
echo "
<tr><td><font>
- <a>$title</a> ($counter "._READS.")
<a><img></a>
</td></tr>
";
}
echo "</table>
<table>"
. " <tr>"
. " <td>"
. " <img></td>"
. " </tr>"
. "</table>
<center>
[ <a>"._SECRETURN."</a> ]</center>";
CloseTable();
include ('footer.php');
}
function viewarticle($artid, $page) {
global $prefix, $dbi, $module_name;
include("header.php");
if (($page == 1) OR ($page == "")) {
sql_query("update ".$prefix."_seccont set counter=counter+1 where artid='$artid'", $dbi);
}
$result = sql_query("select artid, secid, title, content, counter from ".$prefix."_seccont where artid=$artid", $dbi);
list($artid, $secid, $title, $content, $counter) = sql_fetch_row($result, $dbi);
$result2 = sql_query("select secid, secname from ".$prefix."_sections where secid=$secid", $dbi);
list($secid, $secname) = sql_fetch_row($result2, $dbi);
$words = sizeof(explode(" ", $content));
echo "<center>";
OpenTable();
$contentpages = explode( "<pagebreak>", $content );
$pageno = count($contentpages);
if ( $page=="" || $page <1> $pageno )
$page = $pageno;
$arrayelement = (int)$page;
$arrayelement --;
echo"<table>"
. " <tr>"
. " <td><font>Nalazite u kategoriji: <b>$secname</b>, <font>"._TITLE.": <b>$title</b></font><br>[ "._BACKTO." <a>$secname</a> | "._BACKTO1." <a>"._SECINDEX."</a> ]</td>"
. " </tr>"
. "</table>"
."";
echo"<table>"
. " <tr>"
. " <td>"
. " <img></td>"
. " </tr>"
. "</table>"
."";
echo "<left>$contentpages[$arrayelement]</left><br>";
if($page >= $pageno) {
$next_page = "";
} else {
$next_pagenumber = $page + 1;
if ($page != 1) {
$next_page .= "<img> ";
}
$next_page .= "<a>"._NEXT." ($next_pagenumber/$pageno)</a> <a><img></a>";
}
if($page </a>
|