part of articles.php:
- Code: Select all
include "init.php";
// fetching setting info..
$idx_res = query("SELECT * from {$prefix}settings");
if(mysql_num_rows($idx_res)==0)
echo "no data";
else
$idx_row = fetch($idx_res);
// increase number of views
$art_id = intval("".($settings['set_seo_onoff'] == 'on' ? $art_id : $_GET['art_id'])."");
if( $art_id <=0 )//!is_numeric($_GET['art_id']))
die("<br><br><center><b>Please use a proper method to browse article(s) - The method you are using is not allowed...</b></center>");
mysql_query("UPDATE {$prefix}articles SET art_views=art_views+1 WHERE art_id='$art_id'")
or report("$art_id : ".mysql_error());
/*
---------------------------
get articles details here
---------------------------
*/
$art_res=query("SELECT * FROM {$prefix}articles WHERE art_id='$art_id' and art_status='A'") or report();
$rating = getRating($art_id);
if(mysql_num_rows($art_res)==0) {
$redirect_msg = redirect_message("<b>Article not active / approved</b>","
This may be becuase of one of the following reasons<br><br>
<b>• Article may not be approved or still in pending list.<br>
• Article may be deleted by one of the admin.<br>
• Article being investigated by admin and temporarily unavailable.</b>
<br><br>Please use the following links to proceed and perform certain actions.
","<b>Quick options :</b> <a href='$root_path/manage_articles.php'>Manage your articles</a> . <a href='$root_path/myprofile.php'>Edit your profile</a> . <a href='$root_path/archives.php'>View archives</a>","$root_path/index.php",1);
echo $redirect_msg;
cdie();
}
else {
$art_row=fetch($art_res);
$art_url = $settings['set_seo_onoff'] =='on'
? "$root_path/article/".plaintext($art_row['art_title'])."-$art_row[art_id]-1.html"
: "$root_path/articles.php?art_id=$art_row[art_id]&start=1";
if($art_row['art_rss'] !='Y') {
$tres = query("SELECT * FROM {$prefix}authors WHERE aut_id=$art_row[art_user_id]")
or report("gaas:");
$temparr = fetch($tres);
$art_row = array_merge($art_row,$temparr);
}
}
// article view - most recent articles in the category on/off
if($settings['set_mrecent_articles_onoff'] == 'on')
$most_recent_articles_row = most_recent_articles_in_category($art_row["art_cat_id"],$settings['set_mrecent_articles_num']);
else
$most_recent_articles_row = "";
if($settings['set_mviewed_articles_onoff'] == 'on')
$most_viewed_articles_row = most_viewed_articles_in_category($art_row["art_cat_id"],$settings['set_mviewed_articles_num']);
else
$most_viewed_articles_row = "";
if($art_row["art_type"] == "L")
redirect("$art_row[art_url_link]");
if($art_row['art_bbcode'] =='Y')
$art_row['art_full_desc'] = bbcode($art_row['art_full_desc']);
$art_row['art_full_desc'] = glossary_replace($art_row['art_full_desc']);
$art_date = date($date_format,$art_row["art_date"]);
if($art_row['art_rss'] !='Y')
$art_row["aut_bio"] = bbcode(_html($art_row["aut_bio"] ));
/*
------------------------
fetching category name
------------------------
*/
$cat_res=query("select * from {$prefix}category WHERE cat_id=$art_row[art_cat_id]") or report();
if(mysql_num_rows($cat_res)==0) die("cannot find category..");
else {
$cat_row=fetch($cat_res);
$cat_url = $settings['set_seo_onoff'] =='on'
? "$root_path/category/".plaintext($cat_row['cat_name'])."-$cat_row[cat_id]-1.html"
: "$root_path/category.php?cat_id=$cat_row[cat_id]";
}
$catname = changestr($cat_row['cat_name']);
/*
------------------------------------------------
set index page title and meta description tag
------------------------------------------------
*/
$title = "$art_row[art_title]";
$desc = _html($art_row["art_short_desc"]);
$parr = explode($art_row['art_html']=='Y' ? "[pagebreak]" : "[pagebreak]","$art_row[art_full_desc]");
if($settings['set_seo_onoff']=='off') {
$start=1;
if(isset($_GET['start']))
$start=$_GET['start'];
}
$start--;
$pages = count($parr);
$pgs= "";
if($pages > 1) {
$pgs= "Pages : ";
for($i=1; $i<=$pages; $i++) {
$pg = $i;
if($start == $i-1)
$pgs .= " [ <b>$pg</b> ]";
else
$pgs .= $settings['set_seo_onoff']=='on'
? " <a href='$root_path/article/".plaintext($art_row['art_title'])."-$art_row[art_id]-$i.html'>$pg</a>"
: " <a href='$root_path/articles.php?art_id=$art_row[art_id]&start=$i'>$pg</a>";
}
}
$sscript = "
<script>
function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == 'none'){
obj.style.display = '';
return '$images_path/post_comments.gif';
} else {
obj.style.display = 'none';
return '$images_path/post_comments.gif';
}
}
}
</script>";
$art_row['art_full_desc'] = $parr[$start];
include "header.php";
check_site_onoff();
Original url: (article name: Default Article)
-http://localhost/farticle/articles.php?art_id=1&start=1
Url when SEO setting is on:
-http://localhost/farticle/article/default-article-1-1.html
My .htaccess:
- Code: Select all
RewriteEngine On
RewriteBase /farticle/
RewriteRule ^article/(.*)-([0-9]+)-([0-9]+).html$ articles.php?art_id=$1&start=$2 [L]
Still not working, I didn't know how to put the article name on .htaccess.
Please help..

English |
French
News
phpBB SEO

