 |
|
| View previous topic :: View next topic |
| Author |
Message |
Prince Guest
|
Posted: Wed Jul 30, 2003 8:54 am Post subject: |
|
|
I have added mod_rewrite but cannot get 'Sections' to work...
here is what I added and it will not work:
.htacess
#Sections
RewriteRule ^articles.html gate.html?name=Sections
RewriteRule ^listarticles-([a-zA-Z0-9_-]*).html gate.html?name=Sections&op=listarticles&secid=$1
RewriteRule ^viewarticle-([a-zA-Z0-9_-]*).html gate.html?name=Sections&op=viewarticle&artid=$1
urlin
"'(?<!/)gate.html?name=Sections'",
"'(?<!/)gate.html?name=Sections&op=listarticles&secid=([0-9]*)'",
"'(?<!/)gate.html?name=Sections&op=viewarticle&artid=([0-9]*)'",
"'(?<!/)gate.html?name=Sections&op=printpage&artid=([0-9]*)'",
urlout
"listarticles-1.html",
"viewarticle-1.html",
"printarticle-1.html",
"articles.html",
ANY IDEAS???
|
|
| Back to top |
|
 |
|
|
 |
rasputinj Corporal

Joined: 10 May 2003 Posts: 15
|
Posted: Tue Aug 05, 2003 12:13 am Post subject: |
|
|
Here is the working .htaccess I use for my nuke php version 5.6, make sure you have mod_rewrite activated in apache .
| Code: | #*************************************************************************/
#* Googlifier 1.x */
#* for PHP-Nuke and phpBB2 0.x */
#* Based on files provided by sala.net developing an aquanuke.com idea */
#* Totally modified, extended to include phpBB2 0.x port, and maintained */
#* by Imago */
#* WARNING: this is a developing code. Please, regularly update from */
#* http://www.orientalgate.org/downfile42 */
#*************************************************************************/
DirectoryIndex index.php index.cgi index.pl index.shtml index.html
# deny most common except .php
<FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module|exe)$">
deny from all
</FilesMatch>
#Disable .htaccess viewing from browser
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>
<Files ~ "\config.php$">
deny from all
</Files>
ErrorDocument 404 /error.php
RewriteEngine On
RewriteRule ^index.html index.php
RewriteRule ^gate.* modules.php
#Articles
RewriteRule ^article([1-9][0-9]*).* gate.html?name=News&file=article&sid=$1
RewriteRule ^topic([1-9][0-9]*).* gate.html?name=News&new_topic=$1
RewriteRule ^cat([1-9][0-9]*).* gate.html?name=News&file=categories&op=newindex&catid=$1
RewriteRule ^cat([1-9][0-9]*).* gate.html?name=News&file=article&op=newindex&catid=$1
RewriteRule ^printout([1-9][0-9]*).* gate.html?name=News&file=print&sid=$1
RewriteRule ^articles.* gate.html?name=News&file=index
#Content
RewriteRule ^contentid-([1-9][0-9]*).html gate.html?name=Content&pa=showpage&pid=$1
RewriteRule ^content-cat-([1-9][0-9]*).html gate.html?name=Content&pa=list_pages_categories&cid=$1
RewriteRule ^content-staples-([1-9][0-9]*).html gate.html?name=Content&pa=list_pages_dell&cid=$1&sub=Staples
RewriteRule ^content-dell-([1-9][0-9]*).html gate.html?name=Content&pa=list_pages_dell&cid=$1&sub=Dell
#Downloads
RewriteRule ^topdowns.html gate.html?name=Downloads&d_op=TopRated
RewriteRule ^topdowns-(10|25|50)-(num|percent).html topdowns.html&ratenum=$1&ratetype=$2
RewriteRule ^popdowns.html gate.html?name=Downloads&d_op=MostPopular
RewriteRule ^popdowns-(10|25|50)-(num|percent).html popdowns.html&ratenum=$1&ratetype=$2
RewriteRule ^newdowns.html gate.html?name=Downloads&d_op=NewDownloads
RewriteRule ^newdownsw-([0-9]*).html gate.html?name=Downloads&d_op=NewDownloads&newdownloadshowdays=$1
RewriteRule ^newdownsd-([0-9]*).html gate.html?name=Downloads&d_op=NewDownloadsDate&selectdate=$1
RewriteRule ^downcat([0-9]*).html gate.html?name=Downloads&d_op=viewdownload&cid=$1
RewriteRule ^downorder([0-9]*)-([a-zA-Z0-9]*).html gate.html?name=Downloads&d_op=viedownload&cid=$1&orderby=$2
RewriteRule ^downfile([0-9]*) gate.html?name=Downloads&d_op=getit&lid=$1
RewriteRule ^downcat([0-9]*).html&orderby=([a-zA-Z_]*) gate.html?name=Downloads&d_op=viewdownload&cid=$1&orderby=$2
RewriteRule ^downcat([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-([0-9]*).html gate.html?name=Downloads&d_op=viewdownload&cid=$1&min=$2&orderby=$3&show=$4
RewriteRule ^downloads.html gate.html?name=Downloads
#Encyclopedia
RewriteRule ^dic([1-9][0-9]*)all([a-zA-Z0-9]*).* gate.html?name=Encyclopedia&op=terms&eid=$1<r=$2
RewriteRule ^term([1-9][0-9]*)-([1-9][0-9]*).* gate.html?name=Encyclopedia&op=content&tid=$1&page=$2
RewriteRule ^term([1-9][0-9]*).* gate.html?name=Encyclopedia&op=content&tid=$1
RewriteRule ^dic([1-9][0-9]*).* gate.html?name=Encyclopedia&op=list_content&eid=$1
RewriteRule ^encyclopedia.* gate.html?name=Encyclopedia&file=index
#FAQ
RewriteRule ^faq.html gate.html?name=FAQ&file=index
RewriteRule ^faq-([a-zA-Z0-9+]*)-([0-9]*)-([a-zA-Z0-9+]*) gate.html?name=FAQ&myfaq=$1&id_cat=$2&categories=$3
#Members
RewriteRule ^members.html gate.html?name=Members_List
RewriteRule ^members.html gate.html?name=Members_List&file=index
RewriteRule ^members-mode([a-zA-Z0-9]*)-([a-zA-Z0-9]*)-([0-9]*).html gate.html?name=Members_List&file=index&mode=$1&order=$2&start=$3
#Reviews
RewriteRule ^reviews.html gate.html?name=Reviews
RewriteRule ^review([0-9]*).html gate.html?name=Reviews&rop=showcontent&id=$1
RewriteRule ^reviews-new.html gate.html?name=Reviews&rop=write_review
RewriteRule ^reviews-sortby-([a-zA-Z0-9]*).html gate.html?name=Reviews&rop=$1
RewriteRule ^reviews-comment-([0-9]*)-([a-zA-Z0-9]*) gate.html?name=Reviews&rop=postcomment&id=$1&title=$2
RewriteRule ^review([0-9]*)-delete.html gate.html?name=Reviews&rop=del_review&id_del=$1
RewriteRule ^review([0-9]*)-edit.html gate.html?name=Reviews&rop=mod_review&id=$1
#Stories Archive
RewriteRule ^archive.html gate.html?name=Stories_Archive
RewriteRule ^allarticles.html gate.html?name=Stories_Archive&sa=show_all
RewriteRule ^allarticles-([0-9]*).html gate.html?name=Stories_Archive&sa=show_all&min=$1
RewriteRule ^archive([0-9]*)-([0-9]*).* gate.html?name=Stories_Archive&sa=show_month&year=$1&month=$2&month_l=$3
#Surveys
RewriteRule ^surveys.html gate.html?name=Surveys
RewriteRule ^survey([a-zA-Z0-9]*)results.html gate.html?name=Surveys&op=results&pollID=$1
RewriteRule ^survey([a-zA-Z0-9]*).html gate.html?name=Surveys&pollID=$1
#Top10
RewriteRule ^top.html gate.html?name=Top
#Topics
RewriteRule ^chapters.html gate.html?name=Topics
#Web Links
RewriteRule ^addlink.html gate.html?name=Web_Links&l_op=AddLink
RewriteRule ^randomlink.html gate.html?name=Web_Links&l_op=RandomLink
RewriteRule ^toplinks.html gate.html?name=Web_Links&l_op=TopRated
RewriteRule ^poplinks.html gate.html?name=Web_Links&l_op=MostPopular
RewriteRule ^newlinks.html gate.html?name=Web_Links&l_op=NewLinks
RewriteRule ^newlinksw-([0-9]*).html gate.html?name=Web_Links&l_op=NewLinks&newlinkshowdays=$1
RewriteRule ^newlinksd-([0-9]*).html gate.html?name=Web_Links&l_op=NewLinksDate&selectdate=$1
RewriteRule ^vlink([0-9]*).html gate.html?name=Web_Links&l_op=visit&lid=$1
RewriteRule ^links([0-9]*).html gate.html?name=Web_Links&l_op=viewlink&cid=$1
RewriteRule ^linkorder([0-9]*)-([a-zA-Z0-9]*).html gate.html?name=Web_Links&l_op=viewlink&cid=$1&orderby=$2
RewriteRule ^links([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-([0-9]*).html gate.html?name=Web_Links&l_op=viewlink&cid=$1&min=$2&orderby=$3&show=$4
#Your Account
RewriteRule ^userinfo-([/:|\s\-\'{}().&_a-zA-Z0-9+=]*).html gate.html?name=Your_Account&op=userinfo&uname=$1
|
you also need a function to convert the pages to html.
this is in the header.php in the beginning before the require statement.
| Code: | ob_start();
function replace_for_mod_rewrite(&$s)
{
$urlin =
array(
"'(?<!/)index.php'",
"'(?<!/)modules.php'",
"'(?<!/)gate.html\?name=News&file=categories&op=newindex&catid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&file=categories&op=newindex&catid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&file=article&op=newindex&catid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&op=newindex&catid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&file=article&sid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&file=article&sid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&new_topic=([0-9]*)'",
"'(?<!/)gate.html\?name=News&new_topic=([0-9]*)'",
"'(?<!/)gate.html\?name=News&file=print&sid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&file=index'",
"'(?<!/)gate.html\?name=News&file=index'",
"'(?<!/)gate.html\?name=Encyclopedia&op=list_terms&eid=([0-9]*)<r=([a-zA-Z0-9]*)'",
"'(?<!/)gate.html\?name=Encyclopedia&op=list_terms&eid=([0-9]*)<r=([a-zA-Z0-9]*)'",
"'(?<!/)gate.html\?name=Encyclopedia&op=content&tid=([0-9]*)&page=([0-9]*)'",
"'(?<!/)gate.html\?name=Encyclopedia&op=content&tid=([0-9]*)&page=([0-9]*)'",
"'(?<!/)gate.html\?name=Encyclopedia&op=content&tid=([0-9]*)'",
"'(?<!/)gate.html\?name=Encyclopedia&op=content&tid=([0-9]*)'",
"'(?<!/)gate.html\?name=Encyclopedia&op=list_content&eid=([0-9]*)'",
"'(?<!/)gate.html\?name=Encyclopedia&op=list_content&eid=([0-9]*)'",
"'(?<!/)gate.html\?name=Encyclopedia&file=index'",
"'(?<!/)gate.html\?name=Encyclopedia&file=index'",
"'(?<!/)gate.html\?name=Content&pa=showpage&pid=([0-9]*)'",
"'(?<!/)gate.html\?name=Content&pa=list_pages_categories&cid=([0-9]*)'",
"'(?<!/)gate.html\?name=Content&pa=list_pages_dell&cid=([0-9]*)&sub=Staples'",
"'(?<!/)gate.html\?name=Content&pa=list_pages_dell&cid=([0-9]*)&sub=Dell'",
"'(?<!/)gate.html\?name=FAQ&file=index'",
"'(?<!/)gate.html\?name=FAQ&myfaq=([a-zA-Z0-9+]*)&id_cat=([0-9]*)&categories=([a-zA-Z0-9+]*)'",
"'(?<!/)gate.html\?name=Stories_Archive&sa=show_month&year=([0-9]*)&month=([0-9]*)&month_l=([a-ÿA-ß]*)'",
"'(?<!/)gate.html\?name=Stories_Archive&sa=show_all&min=([0-9]*)'",
"'(?<!/)gate.html\?name=Stories_Archive&sa=show_all'",
"'(?<!/)gate.html\?name=Stories_Archive'",
"'(?<!/)gate.html\?name=Chat_Room'",
"'(?<!/)gate.html\?name=Downloads&d_op=TopRated'",
"'(?<!/)topdowns.html&ratenum=(10|25|50)&ratetype=(num|percent)'",
"'(?<!/)gate.html\?name=Downloads&d_op=MostPopular'",
"'(?<!/)popdowns.html&ratenum=(10|25|50)&ratetype=(num|percent)'",
"'(?<!/)gate.html\?name=Downloads&d_op=NewDownloads&newdownloadshowdays=([0-9]*)'",
"'(?<!/)gate.html\?name=Downloads&d_op=NewDownloadsDate&selectdate=([0-9]*)'",
"'(?<!/)gate.html\?name=Downloads&d_op=NewDownloads'",
"'(?<!/)gate.html\?name=Downloads&d_op=getit&lid=([0-9]*)'",
"'(?<!/)gate.html\?name=Downloads&d_op=viewdownload&cid=([0-9]*)&orderby=([a-zA-Z0-9]*)'",
"'(?<!/)gate.html\?name=Downloads&d_op=viewdownload&cid=([0-9]*)&min=([0-9]*)&orderby=([a-zA-Z0-9]*)&show=([0-9]*)'",
"'(?<!/)gate.html\?name=Downloads&d_op=viewdownload&cid=([0-9]*)'",
"'(?<!/)gate.html\?name=(Downloads\")'",
"'(?<!/)gate.html\?name=Reviews&rop=showcontent&id=([0-9]*)'",
"'(?<!/)gate.html\?name=Reviews&rop=write_review'",
"'(?<!/)gate.html\?name=Reviews&rop=postcomment&id=([0-9]*)&title=([a-zA-Z0-9+]*)'",
"'(?<!/)gate.html\?name=Reviews&rop=mod_review&id=([0-9]*)'",
"'(?<!/)gate.html\?name=Reviews&rop=del_review&id_del=([0-9]*)'",
"'(?<!/)gate.html\?name=Reviews&rop=([a-zA-Z0-9]*)'",
"'(?<!/)gate.html\?name=Reviews'",
"'(?<!/)gate.html\?name=Surveys&pollID=([a-zA-Z0-9]*)'",
"'(?<!/)gate.html\?name=Surveys&op=results&pollID=([a-zA-Z0-9]*)'",
"'(?<!/)gate.html\?name=Surveys'",
"'(?<!/)gate.html\?name=Topics'",
"'(?<!/)gate.html\?name=Top'",
"'(?<!/)gate.html\?name=Members_List&file=index&mode=([a-zA-Z0-9]*)&order=([a-zA-Z0-9]*)&start=([0-9]*)'",
"'(?<!/)gate.html\?name=Members_List&file=index'",
"'(?<!/)gate.html\?name=Members_List'",
"'(?<!/)gate.html\?name=Web_Links&l_op=AddLink'",
"'(?<!/)gate.html\?name=Web_Links&l_op=RandomLink'",
"'(?<!/)gate.html\?name=Web_Links&l_op=TopRated'",
"'(?<!/)gate.html\?name=Web_Links&l_op=MostPopular'",
"'(?<!/)gate.html\?name=Web_Links&l_op=NewLinks&newlinkshowdays=([0-9]*)'",
"'(?<!/)gate.html\?name=Web_Links&l_op=NewLinksDate&selectdate=([0-9]*)'",
"'(?<!/)gate.html\?name=Web_Links&l_op=NewLinks'",
"'(?<!/)gate.html\?name=Web_Links&l_op=visit&lid=([0-9]*)'",
"'(?<!/)gate.html\?name=Web_Links&l_op=viewlink&cid=([0-9]*)&orderby=([a-zA-Z0-9]*)'",
"'(?<!/)gate.html\?name=Web_Links&l_op=viewlink&cid=([0-9]*)&min=([0-9]*)&orderby=([a-zA-Z0-9]*)&show=([0-9]*)'",
"'(?<!/)gate.html\?name=Web_Links&l_op=viewlink&cid=([0-9]*)'",
"'(?<!/)gate.html\?name=Your_Account&op=userinfo&uname=([/:|\s\-\'{}().&_a-zA-Z0-9+=]*)'",
"'(?<!/)gate.html\?name=Your_Account&op=userinfo&uname=([/:|\s\-\'{}().&_a-zA-Z0-9+=]*)'"
);
$urlout = array(
"index.html",
"gate.html",
"cat\\1.html",
"cat\\1.html",
"cat\\1.html",
"cat\\1.html",
"article\\1.html",
"article\\1.html",
"topic\\1.html",
"topic\\1.html",
"printout\\1.html",
"articles",
"articles",
"dic\\1all\\2.html",
"dic\\1all\\2.html",
"term\\1-\\2.html",
"term\\1-\\2.html",
"term\\1.html",
"term\\1.html",
"dic\\1.html",
"dic\\1.html",
"encyclopedia.html",
"encyclopedia.html",
"contentid-\\1.html",
"content-cat-\\1.html",
"content-staples-\\1.html",
"content-dell-\\1.html",
"faq.html",
"faq-\\1-\\2-\\3",
"archive\\1-\\2.html",
"allarticles-\\1.html",
"allarticles.html",
"archive.html",
"chat.html",
"topdowns.html",
"topdowns-\\1-\\2.html",
"popdowns.html",
"popdowns-\\1-\\2.html",
"newdownsw-\\1.html",
"newdownsd-\\1.html",
"newdowns.html",
"downfile\\1",
"downorder\\1-\\2.html",
"downcat\\1-\\2-\\3-\\4.html",
"downcat\\1.html",
"downloads.html\"",
"review\\1.html",
"reviews-new.html",
"reviews-comment-\\1-\\2",
"review\\1-edit.html",
"review\\1-delete.html",
"reviews-sortby-\\1.html",
"reviews.html",
"survey\\1.html",
"survey\\1results.html",
"surveys.html",
"chapters.html",
"top.html",
"members-mode\\1-\\2-\\3.html",
"members.html",
"members.html",
"author-\\1.html",
"member-\\1-\\2.html",
"viewforum\\1-\\2-\\3.html",
"ptopic\\1.html",
"ntopic\\1.html",
"ftopic\\1-\\2-\\3-\\4.html",
"ftopic\\1.html",
"ftopic\\1-\\2.html",
"watchtopic\\1-\\2.html",
"unwatchtopic\\1-\\2.html",
"ftopic\\1.html",
"sutra\\1.html",
"sutra\\1.html",
"fcat\\1.html",
"addlink.html",
"randomlink.html",
"toplinks.html",
"poplinks.html",
"newlinksw-\\1.html",
"newlinksd-\\1.html",
"newlinks.html",
"vlink\\1.html",
"linkorder\\1-\\2.html",
"links\\1-\\2-\\3-\\4.html",
"links\\1.html",
"userinfo-\\1.html",
"userinfo-\\1.html"
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
|
You also need this code in the footer.php after the footer(), do not put in any redundant code.
| Code: | $contents = ob_get_contents(); // store buffer in $contents
ob_end_clean(); // delete output buffer and stop buffering
echo replace_for_mod_rewrite($contents); //display modified buffer to screen
global $dbg_starttime; |
This has worked for me. let me know if it works for you, Google now has a few hundred of my pages now and traffic is doing really well, since the mod. |
|
| Back to top |
|
 |
huyhoa Private

Joined: 02 Apr 2006 Posts: 1
|
Posted: Sun Apr 02, 2006 10:03 pm Post subject: Help me Rewrite Url in PHP Nuke News |
|
|
I had done like rasputinj said, and work good. Like url/module.php?name=About --> url/about/
But at New arctile, i write in.htaccess file like:
| Quote: | #Articles
RewriteRule ^article([1-9][0-9]*).* gate.html?name=News&file=article&sid=$1
RewriteRule ^topic([1-9][0-9]*).* gate.html?name=News&new_topic=$1
RewriteRule ^cat([1-9][0-9]*).* gate.html?name=News&file=categories&op=newindex&catid=$1
RewriteRule ^cat([1-9][0-9]*).* gate.html?name=News&file=article&op=newindex&catid=$1
RewriteRule ^printout([1-9][0-9]*).* gate.html?name=News&file=print&sid=$1
RewriteRule ^articles.* gate.html?name=News&file=index
#Content
RewriteRule ^contentid-([1-9][0-9]*).html gate.html?name=Content&pa=showpage&pid=$1
RewriteRule ^content-cat-([1-9][0-9]*).html gate.html?name=Content&pa=list_pages_categories&cid=$1
RewriteRule ^content-staples-([1-9][0-9]*).html gate.html?name=Content&pa=list_pages_dell&cid=$1&sub=Staples
RewriteRule ^content-dell-([1-9][0-9]*).html gate.html?name=Content&pa=list_pages_dell&cid=$1&sub=Dell |
And i dont know how to config link in the New module. This is index.php in my New module :
| Quote: | include("header.php");
automated_news();
$numstories = $db->sql_numrows($db->sql_query("select * from ".$prefix."_stories WHERE ihome='0' $querylang"));
$numpages = ceil($numstories / $newspagenum);
if (($newshome == 1) AND ($home == 1)) {
$result = $db->sql_query("SELECT catid, title, linkshome, storieshome, catimage FROM ".$prefix."_stories_cat WHERE ihome='0' ORDER BY weight");
if ($db->sql_numrows($result) > 0) {
while ($row = $db->sql_fetchrow($result)) {
$cat_id = intval($row['catid']);
$cat_title = stripslashes(check_html($row['title'], "nohtml"));
$linkshome = $row['linkshome'];
$storieshome = $row['storieshome'];
$catimage = $row['catimage'];
if ($storieshome != 0) {
$result2 = $db->sql_query("SELECT * FROM ".$prefix."_stories WHERE sid='$storieshome'");
} else {
$result2 = $db->sql_query("SELECT * FROM ".$prefix."_stories WHERE catid='$cat_id' AND (ihome='0' AND sid!='$news_start_id') $querylang ORDER BY sid DESC LIMIT 0,1");
}
$num2 = $db->sql_numrows($result2);
if ($num2 != 0) {
if ($catimgnewshome == 1) {
if ($catimage == "") { $catimage = "AllTopics.gif"; }
$size2 = getimagesize("images/cat/$catimage");
$catimg = "<a href=\"modules.php?name=News&file=categories&catid=$cat_id\" title=\"$cat_title\"><img border=\"0\" src=\"images/cat/$catimage\" width=\"$size2[0]\" hspace=\"3\" vspace=\"3\"></a>";
} else {
$catimg = "";
}
categoryname($cat_title, $cat_id, $catimg);
$row2 = $db->sql_fetchrow($result2);
$sid = intval($row2['sid']);
$aid = stripslashes($row2['aid']);
$title = stripslashes(check_html($row2['title'], "nohtml"));
$time = $row2['time'];
$hometext = stripslashes($row2['hometext']);
$bodytext = stripslashes($row2['bodytext']);
$images = $row2['images'];
$comments = stripslashes($row2['comments']);
$counter = intval($row2['counter']);
$notes = stripslashes($row2['notes']);
$acomm = intval($row2['acomm']);
$imgtext = stripslashes(check_html($row2['imgtext'], "nohtml"));
$source = stripslashes(check_html($row2['source'], "nohtml"));
$topicid = intval($row2['topicid']);
$title = "<a href=\"modules.php?name=News&file=article&sid=$sid\" class=\"storytitle\">$title</a>";
formatTimestamp($time);
if ($bodytext != "") {
$story_link = "<a href=\"modules.php?name=News&file=article&sid=$sid\"><b>"._READMORE."</b></a>";
} else {
$story_link = "";
}
$print = "";
$com_link = "";
if (is_admin($admin)) {
$com_link .= " ("._COMMENTSQ.": $comments | ";
$tot_hits = ""._TOTHITS.": $counter | <a href=\"admin/admin.php?op=EditStory&sid=$sid\">"._EDIT."</a> | <a href=\"admin/admin.php?op=RemoveStory&sid=$sid\">"._DELETE."</a>)";
}
if ($images != "") {
$size2 = getimagesize("$path/$images");
$widthimg = $size2[0];
if ($size2[0] > $sizecatnewshomeimg) { $widthimg = $sizecatnewshomeimg; }
$xtitle = stripslashes(check_html($row2['title'], "nohtml"));
$story_pic = "<table border=\"0\" width=\"$widthimg\" cellpadding=\"0\" cellspacing=\"3\" align=\"$catnewshomeimg\">\n<tr>\n<td>\n<a href=\"modules.php?name=News&file=article&sid=$sid\"><img style=\"border: 1px solid #4D5764\" src=\"$path/$images\" width=\"$widthimg\" alt=\"$imgtext\"></a></td>\n</tr>\n</table>\n";
} else {
$story_pic = "";
}
$notes = "";
$result3 = $db->sql_query("SELECT sid, time, title FROM ".$prefix."_stories WHERE catid='$cat_id' AND (ihome='0' AND sid!='$sid' AND sid!='$news_start_id') $querylang ORDER BY sid DESC LIMIT $linkshome");
$num3 = $db->sql_numrows($result3);
if ($num3 != 0) {
$notes .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td width=\"100%\">\n";
$notes .= "<ul style=\"margin-left: 15\">";
while ($row3 = $db->sql_fetchrow($result3)) {
$sid3 = intval($row3['sid']);
$title3 = stripslashes(check_html($row3['title'], "nohtml"));
$time3 = formatTimestamp($row3['time']);
$size3 = getimagesize("modules/$module_name/images/arrow3.gif");
$widthimg3 = $size3[0];
$notes .= "<li style=\"list-style-image: url('modules/$module_name/images/arrow3.gif'); margin-right: 0; margin-bottom: 2\"><a href='modules.php?name=News&file=article&sid=$sid3' class=indexlink>$title3</a> <font class=grey>[$time3]</font></li>";
}
$notes .= "</td></tr></table>";
}
themeindex($aid, $datetime, $title, $hometext, $story_pic, $notes, $story_link, $com_link, $tot_hits);
}
}
}
} else {
if ($home == 1) {
$result = $db->sql_query("SELECT * FROM ".$prefix."_stories WHERE (ihome='0' AND sid!='$news_start_id') $querylang ORDER BY sid DESC limit 0, $newshomenum");
} else {
if (($pagenum=="") OR ($pagenum < 1)) { $pagenum = 1; }
if ($pagenum > $numpages) { $pagenum = $numpages; }
$offset = ($pagenum-1) * $newspagenum;
$result = $db->sql_query("SELECT * FROM ".$prefix."_stories WHERE ihome='0' $querylang ORDER BY sid DESC limit $offset, $newspagenum");
}
while ($row = $db->sql_fetchrow($result)) {
$sid = intval($row['sid']);
$catid = intval($row['catid']);
$aid = stripslashes($row['aid']);
$title = stripslashes(check_html($row['title'], "nohtml"));
$time = $row['time'];
$hometext = stripslashes($row['hometext']);
$bodytext = stripslashes($row['bodytext']);
$images = $row['images'];
$comments = stripslashes($row['comments']);
$counter = intval($row['counter']);
$notes = stripslashes($row['notes']);
$acomm = intval($row['acomm']);
$imgtext = stripslashes(check_html($row['imgtext'], "nohtml"));
$source = stripslashes(check_html($row['source'], "nohtml"));
$topicid = intval($row['topicid']);
if ($catid > 0) {
$row2 = $db->sql_fetchrow($db->sql_query("SELECT title, catimage FROM ".$prefix."_stories_cat WHERE catid='$catid'"));
$cattitle = stripslashes(check_html($row2['title'], "nohtml"));
$catimage = $row2['catimage'];
if ($catimgnewshome == 1) {
if ($catimage == "") { $catimage = "AllTopics.gif"; }
if ($catnewshomeimg == "right") { $fl = "left"; }
if ($catnewshomeimg == "left") { $fl = "right"; }
$size2 = getimagesize("images/cat/$catimage");
$title = "<a href=\"modules.php?name=News&file=categories&catid=$catid\" title=\"$cattitle\"><img border=\"0\" src=\"images/cat/$catimage\" width=\"$size2[0]\" style=\"float: $fl\"></a> <a href=\"modules.php?name=News&file=article&sid=$sid\" class=\"storytitle\">$title</a>";
} else {
$title = "<a href=\"modules.php?name=News&file=categories&catid=$catid\" class=\"storytitle\">$cattitle:</a> <a href=\"modules.php?name=News&file=article&sid=$sid\" class=\"storytitle\">$title</a>";
}
} else {
if ($catimgnewshome == 1) {
$catimage = "AllTopics.gif";
if ($catnewshomeimg == "right") { $fl = "left"; }
if ($catnewshomeimg == "left") { $fl = "right"; }
$size2 = getimagesize("images/cat/$catimage");
$title = "<a href=\"modules.php?name=News&file=categories&catid=0\"><img border=\"0\" src=\"images/cat/$catimage\" width=\"$size2[0]\" style=\"float: $fl\"></a> <a href=\"modules.php?name=News&file=article&sid=$sid\" class=\"storytitle\">$title</a>";
} else {
$title = "<a href=\"modules.php?name=News&file=article&sid=$sid\" class=\"storytitle\">$title</a>";
}
}
formatTimestamp($time);
if ($bodytext != "") {
$story_link = "<a href=\"modules.php?name=News&file=article&sid=$sid\"><b>"._READMORE."</b></a>";
} else {
$story_link = "";
}
$com_link = "";
$tot_hits = "";
if (is_admin($admin)) {
$com_link = " ("._COMMENTSQ.": $comments | ";
$tot_hits = ""._TOTHITS.": $counter | <a href=\"admin/admin.php?op=EditStory&sid=$sid\">"._EDIT."</a> | <a href=\"admin/admin.php?op=RemoveStory&sid=$sid\">"._DELETE."</a>) ";
}
if ($images != "") {
$size2 = getimagesize("$path/$images");
$widthimg = $size2[0];
if ($size2[0] > $sizecatnewshomeimg) { $widthimg = $sizecatnewshomeimg; }
$xtitle = stripslashes(check_html($row['title'], "nohtml"));
$story_pic = "<table border=\"0\" width=\"$widthimg\" cellpadding=\"0\" cellspacing=\"3\" align=\"$catnewshomeimg\">\n<tr>\n<td>\n<a href=\"modules.php?name=News&file=article&sid=$sid\"><img border=\"0\" src=\"$path/$images\" width=\"$widthimg\" alt=\"$imgtext\" style=\"border: 1px solid #4D5764\"></a></td>\n</tr>\n</table>\n";
} else {
$story_pic = "";
}
$notes = "";
themeindex($aid, $datetime, $title, $hometext, $story_pic, $notes, $story_link, $com_link, $tot_hits);
}
#START Page Numbers
if ($home == 1) {
if ($numstories > $newshomenum) {
$xnum = ceil(($newshomenum + 1) / $newspagenum);
OpenTable();
echo "<center>";
echo "<a href=\"modules.php?name=News&pagenum=$xnum\"><b>"._MORENEWS2."</b></a>";
echo "</center>" ;
CloseTable();
}
} else {
if ($numpages > 1) {
OpenTable();
echo "<center>";
if ($pagenum > 1) {
$prevpage = $pagenum - 1 ;
$leftarrow = "images/left.gif";
echo "<a href=\"modules.php?name=News&pagenum=$prevpage\">";
echo "<img src=\"$leftarrow\" align=\"absmiddle\" border=\"0\" hspace=\"10\"></a>";
}
for ($i=1; $i < $numpages+1; $i++) {
if ($i == $pagenum) {
echo "<b>$i</b>";
} else {
$pagelink = 5;
if (($i > $pagenum) AND ($i < $pagenum+$pagelink) OR ($i < $pagenum) AND ($i > $pagenum-$pagelink)) {
echo " <a href=\"modules.php?name=News&pagenum=$i\">$i</a> ";
}
if (($i == $numpages) AND ($pagenum < $numpages-$pagelink)){
echo "... <a href=\"modules.php?name=News&pagenum=$i\">$i</a>";
}
if (($i == 1) AND ($pagenum > 1+$pagelink)){
echo "<a href=\"modules.php?name=News&pagenum=$i\">$i</a> ...";
}
}
}
if ($pagenum < $numpages) {
$nextpage = $pagenum + 1 ;
$rightarrow = "images/right.gif" ;
echo "<a href=\"modules.php?name=News&pagenum=$nextpage\">";
echo "<img src=\"$rightarrow\" align=\"absmiddle\" border=\"0\" hspace=\"10\"></a>";
}
echo "</center>" ;
CloseTable();
}
}
#END Page Numbers
}
if ($comblbarstat) {
combl_bar($catid);
}
include("footer.php"); |
And this is arcticle.php file:
| Quote: |
function bottomblock_tlq($sid, $topicid, $querylang) {
global $module_name, $prefix, $db, $bgcolor3;
include("includes/data/news_config.php");
$sid = intval($sid);
if ($topicid != 0) {
$xhienthi_tlq = $hienthi_tlq + 1;
$resulttopic = $db->sql_query("select sid, time, title FROM ".$prefix."_stories where topicid='$topicid' AND sid!='$sid' $querylang ORDER BY sid DESC LIMIT 0,$xhienthi_tlq");
if ($numrowstopic = $db->sql_numrows($resulttopic) > 0) {
OpenTable();
echo "<div style=\"margin-bottom: 3px\"><font class=\"topmore\"><b>"._TINLQ.":</b></font>\n</div>\n";
$q = 1;
while ($rowtopic = $db->sql_fetchrow($resulttopic)) {
$tsid = intval($rowtopic['sid']);
$ttitle = stripslashes(check_html($rowtopic['title'], "nohtml"));
$ttime = formatTimestamp($rowtopic['time']);
if ($q <= $hienthi_tlq) {
$size3 = getimagesize("modules/$module_name/images/arrow2.gif");
echo "<img border=\"0\" src=\"modules/$module_name/images/arrow2.gif\" width=\"$size3[0]\" height=\"$size3[1]\"><a href=\"modules.php?name=News&file=article&sid=$tsid\" class=\"indexhometext\">$ttitle</a> ($ttime)<br>\n";
}
if ($q == $xhienthi_tlq) {
echo "<div style=\"margin-top: 3px\" align=\"right\"><a href=\"modules.php?name=News&file=topics&topicid=$topicid\" class=\"indexhometext\"><b><u>"._READMORE."</u></b></a></div>\n";
}
$q++;
}
CloseTable();
echo "<br>";
}
}
}
function bottomblock_ccd($sid, $catid, $querylang) {
global $module_name, $prefix, $db, $bgcolor2;
include("includes/data/news_config.php");
$sid = intval($sid);
if ($catid != 0) {
$xhienthi_ccd = $hienthi_ccd + 1;
$resultcat = $db->sql_query("select sid, time, title FROM ".$prefix."_stories where catid='$catid' AND sid!='$sid' $querylang ORDER BY sid DESC LIMIT 0,$xhienthi_ccd");
if ($db->sql_numrows($resultcat) > 0) {
echo "<font class=\"topmore\"><b>"._TINCCD.":</b></font>\n<br>\n";
$c = 1;
while ($rowcat = $db->sql_fetchrow($resultcat)) {
$csid = intval($rowcat['sid']);
$ctitle = stripslashes(check_html($rowcat['title'], "nohtml"));
$ctime = formatTimestamp($rowcat['time']);
if ($c <= $hienthi_ccd) {
$size3 = getimagesize("modules/$module_name/images/arrow.gif");
echo "<div style=\"margin-top: 3px; margin-bottom: 3px\"><img border=\"0\" src=\"modules/$module_name/images/arrow.gif\" width=\"$size3[0]\" height=\"$size3[1]\"><a href=\"modules.php?name=News&file=article&sid=$csid\" class=\"indexhometext\">$ctitle</a> ($ctime)</div>\n";
}
if ($c == $xhienthi_ccd) {
echo "<div style=\"margin-top: 3px\" align=\"right\"><a href=\"modules.php?name=News&file=categories&catid=$catid&start=$csid\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._READMORE."'; return true;\"><b><u><font class=\"indexhometext\">"._READMORE."</font></u></b></a></div>\n";
}
$c++;
}
echo "<hr style=\"border:2px solid $bgcolor2;\">\n";
}
}
}
function viewimg($imglink) {
global $module_name;
include("includes/data/news_config.php");
echo"<html>\n<head>\n"
. "<meta http-equiv=\"Content-Type\" content=\"text/html; charset="._CHARSET."\">\n"
. "<title>"._VIEWIMG."</title>\n</head>\n<body bgcolor=\"#ECF3FB\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\">\n"
. "<p><a href=\"\" onclick=\"window.close();\"><img border=\"0\" src=\"$imglink\" alt=\""._CLOSEWIN."\"></a></p>\n"
. "</body>\n</html>";
}
function userbar($sid, $acomm, $comments) {
global $module_name, $articlecomm, $admin, $user, $bgcolor2;
include("includes/data/news_config.php");
$sid = intval($sid);
$test = "";
if ((is_admin($admin)) || ($newsprint==1) || ($newsprint==2 AND (is_user($user)))) {
$size3 = getimagesize("images/print.gif");
$test .= " <a href=\"javascript:;\" onClick=\"MM_openBrWindow('modules.php?name=$module_name&file=print&sid=$sid','','scrollbars=yes,width=640,height=500')\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._PRINTER."'; return true;\"><img src=\"images/print.gif\" border=\"0\" alt=\""._PRINTER."\" title=\""._PRINTER."\" width=\"$size3[0]\" height=\"$size3[1]\"></a>\n";
}
if ((is_admin($admin)) || ($newssave==1) || ($newssave==2 AND (is_user($user)))) {
$size3 = getimagesize("images/save.gif");
$test .= " <a href=\"modules.php?name=$module_name&file=save&sid=$sid\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._SAVE."'; return true;\"><img src=\"images/save.gif\" border=\"0\" alt=\""._SAVE."\" title=\""._SAVE."\" width=\"$size3[0]\" height=\"$size3[1]\"></a>\n";
}
if ((is_admin($admin)) || ($newsfriend==1) || ($newsfriend==2 AND (is_user($user)))) {
$size3 = getimagesize("images/friend.gif");
$test .= " <a href=\"javascript:;\" onClick=\"MM_openBrWindow('modules.php?name=$module_name&file=friend&op=FriendSend&sid=$sid','','scrollbars=no,width=400,height=370')\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._FRIEND."'; return true;\"><img src=\"images/friend.gif\" border=\"0\" alt=\""._FRIEND."\" title=\""._FRIEND."\" width=\"$size3[0]\" height=\"$size3[1]\"></a>\n";
}
if ((is_admin($admin)) || ($articlecomm == 1 AND $acomm == 0) || ($articlecomm == 2 AND $acomm == 0 AND (is_user($user)))) {
$size3 = getimagesize("images/comm.gif");
$test .= " <a href=\"javascript:;\" onClick=\"MM_openBrWindow('modules.php?name=$module_name&file=comm&sid=$sid','','scrollbars=no,width=500,height=500')\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._COMMENTSQ."'; return true;\"><img src=\"images/comm.gif\" border=\"0\" alt=\""._COMMENTSQ."\" title=\""._COMMENTSQ."\" width=\"$size3[0]\" height=\"$size3[1]\"></a>\n";
}
if ($test != "") {
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td>\n$test\n</td>\n";
if (is_admin($admin)) {
echo "<td align=\"right\">[ <a href=\"admin/admin.php?op=adminnews\">"._ADD."</a> | <a href=\"admin/admin.php?op=EditStory&sid=$sid\">"._EDIT."</a> | <a href=\"admin/admin.php?op=RemoveStory&sid=$sid\">"._DELETE."</a> ]</td>\n";
}
if (($comments!=0) AND ((is_admin($admin)) || ($articlecomm == 1 AND $acomm == 0) || ($articlecomm == 2 AND $acomm == 0 AND (is_user($user))))) {
echo "<td align=\"right\"><b><a href=\"modules.php?name=$module_name&file=article&op=showcomm&sid=$sid\">"._READREST."</a></b> ("._ALL.": $comments)</td>";
}
echo "</tr></table>\n";
echo "<hr style=\"border:2px solid $bgcolor2;\"><br>\n";
}
}
function showcomm($sid) {
global $prefix, $user_prefix, $db, $user, $cookie, $module_name, $admin, $page_title, $pagenum, $index, $bgcolor2, $bgcolor3, $bgcolor4, $ThemeSel;
require_once("includes/data/news_config.php");
$index = $articleindex;
$sid = intval($sid);
if (stristr($REQUEST_URI,"mainfile")) {
Header("Location: modules.php?name=News&file=article&op=showcomm&sid=$sid");
}
if (!isset($sid)) {
Header("Location: index.php");
}
$result1 = $db->sql_query("SELECT title, acomm, topicid, catid FROM ".$prefix."_stories WHERE sid='$sid'");
$row = $db->sql_fetchrow($result1);
$title = stripslashes(check_html($row['title'], "nohtml"));
$acomm = intval($row['acomm']);
$topicid = intval($row['topicid']);
$catid = intval($row['catid']);
if ((!is_admin($admin)) AND (($db->sql_numrows($result1) != 1) OR ($articlecomm == 0) OR ($acomm == 1))) {
Header("Location: index.php");
exit;
}
$page_title = ""._COMMENTSAR.": $title";
if ($pagenum == "") { $pagenum = 1; }
$offset = ($pagenum-1) * $newspagenum;
if ($pagenum) { $a = $offset+1; } else { $a = 1; }
$result2 = $db->sql_query("SELECT * FROM ".$prefix."_stories_comments WHERE sid='$sid' ORDER BY date desc LIMIT $offset, $newspagenum");
if ($db->sql_numrows($result2) == 0) {
Header("Location: index.php");
exit;
}
include("header.php");
$title = "<a href=\"modules.php?name=News&file=article&sid=$sid\" class=\"storytitle\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._ARTICLECONTENT."'; return true;\">$title</a>";
echo"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td valign=\"top\">"
. "<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\" width=\"100%\">\n"
. "<tr>\n<td align=\"center\">\n<a name=\"top\"></a>\n$title\n"
. "</td>\n</tr><tr>\n<td align=\"center\"><a href=\"modules.php?name=$module_name&file=article&sid=$sid\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._ARTICLECONTENT."'; return true;\">"
. ""._ARTICLECONTENT."\n<a> | <a href=\"javascript:;\" onClick=\"MM_openBrWindow('modules.php?name=$module_name&file=comm&sid=$sid','','scrollbars=no,width=500,height=500')\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._COMMENTSQ."'; return true;\">"._COMMENTSQ."</a>\n</td>\n</tr>\n</table>\n"
. "<hr style=\"border-style: dotted; border-width: 1px\">";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
$a = 0;
while ($row = $db->sql_fetchrow($result2)) {
$tid = intval($row['tid']);
$send_date = formatTimestamp($row['date']);
$sender_name = $row['name'];
$sender_email = ", Email: <a href=\"mailto:$row[email]\" class=\"indexhometext\">$row[email]</a>";
$result3 = $db->sql_query("SELECT username, user_viewemail FROM ".$user_prefix."_users WHERE username='$sender_name'");
$row3 = $db->sql_fetchrow($result3);
$viewmail = $row3['user_viewemail'];
if ($db->sql_numrows($result3) == 1) {
$sender_name = "<a href=\"modules.php?name=Your_Account&op=userinfo&username=$sender_name\" class=\"indexhometext\">$sender_name</a>";
if ((!is_admin($admin)) && ($viewmail == 0)) {
$sender_email = "";
}
}
$sender_host = $row['host_name'];
$com_text = $row['comment'];
$ip = "<a title=\""._TOP_PAGE."\" href=\"#top\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._TOP_PAGE."'; return true;\"><img border=\"0\" src=\"themes/$ThemeSel/images/navigate_up.gif\" width=\"15\" height=\"15\" vspace=\"3\"></a>\n";
$delcomm = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('modules.php?name=$module_name&file=comm&sid=$sid','','scrollbars=no,width=500,height=500')\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._COMMENTSQ."'; return true;\"><img border=\"0\" src=\"modules/$module_name/images/comm_element.gif\" width=\"24\" height=\"24\" hspace=\"3\" vspace=\"3\" alt=\""._COMMENTSQ."\" title=\""._COMMENTSQ."\"></a>";
if (is_admin($admin)) {
$ip = "I <a href=\"admin/admin.php?op=ConfigureBan&bad_ip=$sender_host\" class=\"indexhometext\">$sender_host</a>\n";
$delcomm = "<a href=\"admin/admin.php?op=EditStoriesComment&tid=$tid\" title=\""._EDIT."\"><img border=\"0\" src=\"modules/$module_name/images/comm_element.gif\" width=\"24\" height=\"24\" hspace=\"3\" vspace=\"3\"></a>";
}
$bgcolor = $bgcolor4;
if ($a%2 == 1) {
$bgcolor = $bgcolor3;
}
echo"<tr>\n<td>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
. "<tr>\n<td style=\"border-left:2px solid #DE0021\">\n"
. "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
. "<tr>\n<td width=\"30\" style=\"border-top:2px solid #DE0021\">$delcomm</td>\n<td>\n"
. "<li type=\"circle\" class=\"indexhometext\">"._SENDCOMM.": $sender_name$sender_email</li>\n"
. "<li type=\"circle\" class=\"indexhometext\">"._COMMDATE.": $send_date</li>\n</td>\n"
. "<td align=\"right\" class=\"indexhometext\">$ip</td>\n</tr>\n</table>\n</td>\n</tr>\n<tr>\n"
. "<td style=\"border-left:2px solid #DE0021; border-bottom:2px solid #FFB927; background-color: $bgcolor\">\n"
. "<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\" width=\"100%\">\n"
. "<tr>\n<td class=\"indexhometext\">$com_text</td>\n</tr>\n</table>\n"
. "</td>\n</tr>\n<tr>\n<td> </td>\n</tr>\n</table>\n</td>\n</tr>\n";
$a++;
}
echo "</table>";
#START Page Numbers
$result_pn = $db->sql_query("select * from ".$prefix."_stories_comments WHERE sid='$sid'");
$numstories = $db->sql_numrows($result_pn);
$numpages = ceil($numstories / $newspagenum);
if ($numpages > 1) {
echo "<hr style=\"border-style: dotted; border-width: 1px\"><div align=\"right\">"._COMMPAGE.": " ;
if ($pagenum > 1) {
$prevpage = $pagenum - 1 ;
$leftarrow = "<<" ;
echo "<a href=\"modules.php?name=News&file=article&op=showcomm&sid=$sid&pagenum=$prevpage\">";
echo "$leftarrow</a> ";
}
for ($i=1; $i < $numpages+1; $i++) {
if ($i == $pagenum) {
echo "<b>$i</b>";
}
else {
$pagelink = 5;
if (($i > $pagenum) AND ($i < $pagenum+$pagelink) OR ($i < $pagenum) AND ($i > $pagenum-$pagelink)) {
echo " <a href=\"modules.php?name=News&file=article&op=showcomm&sid=$sid&pagenum=$i\">$i</a> ";
}
if (($i == $numpages) AND ($pagenum < $numpages-$pagelink)){
echo "... <a href=\"modules.php?name=News&file=article&op=showcomm&sid=$sid&pagenum=$i\">$i</a>";
}
if (($i == 1) AND ($pagenum > 1+$pagelink)){
echo "<a href=\"modules.php?name=News&file=article&op=showcomm&sid=$sid&pagenum=$i\">$i</a> ...";
}
}
}
if ($pagenum < $numpages) {
$nextpage = $pagenum + 1 ;
$rightarrow = ">>" ;
echo " <a href=\"modules.php?name=News&file=article&op=showcomm&sid=$sid&pagenum=$nextpage\">";
echo "$rightarrow</a>";
}
echo "</div>" ;
}
#END Page Numbers
echo "</td>\n";
if (($articleindex==0) OR (($articleindex==1) AND ($sizeblock_atl!=0))) {
echo "<td><img border=\"0\" src=\"themes/$ThemeSel/images/spacer.gif\" width=\"8\" height=\"1\"></td>\n";
}
if ($sizeblock_atl!=0) {
echo"<td width=\"$sizeblock_atl\" valign=\"top\">\n";
include("modules/$module_name/blocks/sukienqaCat.php");
if ($block_top10topic==1) {
include("modules/$module_name/blocks/Top10topics.php");
}
if ($block_top10count == 1) {
$xsid = $sid;
include("modules/$module_name/blocks/Top10articlesCCD.php");
}
echo"</td>\n";
}
echo "</tr>\n</table>";
include("footer.php");
}
switch($op) {
case "viewimg":
viewimg($imglink);
break;
case "showcomm":
showcomm($sid);
break;
default:
global $currentlang, $multilingual, $prefix, $user_prefix, $db, $admin, $anonymous, $articlecomm, $module_name, $page_title, $datetime, $index, $bgcolor2, $ThemeSel, $user;
require_once("includes/data/news_config.php");
$index = $articleindex;
if (stristr($REQUEST_URI,"mainfile")) {
Header("Location: modules.php?name=$module_name&file=article&sid=$sid");
} elseif (!isset($sid)) {
Header("Location: index.php");
}
$sid = intval($sid);
$result1 = $db->sql_query("select * FROM ".$prefix."_stories where sid='$sid'");
if ($numrows = $db->sql_numrows($result1) != 1) {
Header("Location: index.php");
die();
}
$row = $db->sql_fetchrow($result1);
$catid = intval($row['catid']);
$aid = stripslashes($row['aid']);
$time = formatTimestamp($row['time']);
$title = stripslashes(check_html($row['title'], "nohtml"));
$hometext = stripslashes($row['hometext']);
$bodytext = stripslashes($row['bodytext']);
$images = $row['images'];
$imgtext = stripslashes(check_html($row['imgtext'], "nohtml"));
$notes = stripslashes($row['notes']);
$acomm = intval($row['acomm']);
$comments = stripslashes($row['comments']);
$topicid = intval($row['topicid']);
$source = stripslashes(check_html($row['source'], "nohtml"));
$db->sql_query("UPDATE ".$prefix."_stories SET counter=counter+1 where sid=$sid");
$page_title = $title;
include("header.php");
$checkuser = $db->sql_numrows($db->sql_query("select * from ".$user_prefix."_users where username='$aid'"));
if ($checkuser == 1) {
$aid = "<a href=\"modules.php?name=Your_Account&op=userinfo&username=$aid\">$aid</a>";
}
if (($notes != "") AND (($sizeblock_atl==0) OR (($sizeblock_atl!=0) AND ($block_pl==0)))) {
if ($newsarticleimg == "left") { $alignnote = "right"; }
if ($newsarticleimg == "right") { $alignnote = "left"; }
$bodytext = "<table border=\"0\" style=\"border-collapse: collapse\" width=\"35%\" cellpadding=\"1\" cellspacing=\"5\" align=\"$alignnote\" bgcolor=\"$bgcolor2\">\n<tr>\n<td><font class=indexhometext><i>$notes</i></font></td>\n</tr>\n</table>\n$bodytext";
}
if ($source != "") { $source = "("._ISTOK." <i>$source</i>)"; }
if ($images != "") {
$ximages = "$path/$images";
$size2 = getimagesize("$ximages");
if ($size2[0] > $sizenewsarticleimg) {
$story_pic = "<table border=\"0\" width=\"$sizenewsarticleimg\" cellpadding=\"0\" cellspacing=\"3\" align=\"$newsarticleimg\">\n<tr>\n<td>\n
<a href=\"javascript:;\" onClick=\"MM_openBrWindow('modules.php?name=$module_name&file=article&op=viewimg&imglink=$ximages','','scrollbars=no,width=$size2[0],height=$size2[1],resizable=1')\" onMouseOut=\"window.status=''; return true;\" onMouseOver=\"window.status='"._VIEWIMG."'; return true;\">
<img style=\"border: 1px solid #4D5764\" src=\"$path/$images\" width=\"$sizenewsarticleimg\" alt=\""._VIEWIMG."\"></a></td>\n</tr>\n<tr>\n<td align=\"center\">$imgtext</td>\n</tr>\n</table>\n";
} else {
$story_pic = "<table border=\"0\" width=\"$size2[0]\" cellpadding=\"0\" cellspacing=\"3\" align=\"$newsarticleimg\">\n<tr>\n<td>\n
<img style=\"border: 1px solid #4D5764\" src=\"$path/$images\" width=\"$size2[0]\" alt=\"$imgtext\"></td>\n</tr>\n<tr>\n<td align=\"center\">$imgtext</td>\n</tr>\n</table>\n";
}
} else {
$story_pic = "";
}
echo"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td valign=\"top\">";
themearticle($aid, $time, $title, $hometext, $bodytext, $story_pic, $source);
if ($multilingual == 1) {
$querylang = "AND (alanguage='$currentlang' OR alanguage='')";
} else {
$querylang = "";
}
if ($hienthi_tlq > 0) {
bottomblock_tlq($sid, $topicid, $querylang);
}
userbar($sid, $acomm, $comments);
if ($hienthi_ccd > 0) {
bottomblock_ccd($sid, $catid, $querylang);
}
if ($comblbarstat) {
combl_bar($catid);
}
echo "</td>\n";
if (($articleindex==0) OR (($articleindex==1) AND ($sizeblock_atl!=0))) {
echo "<td><img border=\"0\" src=\"themes/$ThemeSel/images/spacer.gif\" width=\"8\" height=\"1\"></td>\n";
}
if ($sizeblock_atl!=0) {
echo"<td width=\"$sizeblock_atl\" valign=\"top\">\n";
imgalbum($sid);
if (($block_pl ==1) AND ($notes != "")) {
OpenTable3();
echo"<center><b>"._PLSTORY."</b></center>\n<br>$notes\n";
CloseTable3();
}
if ($block_top10topic==1) {
include("modules/$module_name/blocks/Top10topics.php");
}
if ($block_top10count == 1) {
$xsid = $sid;
include("modules/$module_name/blocks/Top10articlesCCD.php");
}
if ($block_top10articles == 1) {
$sid = "";
include("modules/$module_name/blocks/Top10articles.php");
}
echo"</td>\n";
}
echo "</tr>\n</table>";
include ("footer.php"); |
This is develope from PHP-Nuke 7.6 |
|
| Back to top |
|
 |
mical99 Private

Joined: 25 Oct 2009 Posts: 1
|
Posted: Sun Oct 25, 2009 9:35 pm Post subject: |
|
|
Apache processes a HTTP request in several phases. A hook for each of these phases is provided by the Apache API. mod_rewrite uses two of these hooks: the URL-to-filename translation hook (used after the HTTP request has been read, but before any authorization starts) and the Fixup hook (triggered after the authorization phases, and after the per-directory config files (.htaccess) have been read, but before the content handler is activated).
Once a request comes in, and Apache has determined the appropriate server (or virtual server), the rewrite engine starts the URL-to-filename translation, processing the mod_rewrite directives from the per-server configuration. A few steps later, when the final data directories are found, the per-directory configuration directives of mod_rewrite are triggered in the Fixup phase.
____________________________
640-460 practice exam | 650-175 practice exam |
|
| Back to top |
|
 |
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|