Problem importing news from feed This is really excellent, thanks for all this info! The only problem I'm finding is for the review pages. What I would like to know is how to modify all links around the site to this new method. For example, when you have finished reading page 1 of a review and want to move onto page two you would usually use the "Next Page" link. What link you see here is determined by review.php and not in a termplate so how do you modify this code to link to review_graphics_card_p2.html thankyee
Problem importing news from feed You are looking for the following code in review.php: Code: if ($pages > $page) { $page_next = $page + 1; $insert[review_next_url] = "review.php?id=$id&page=$page_next"; $insert[review_next] = GetTemplate("review_next_page"); } if ($page > 1) { $page_previous = $page - 1; $insert[review_previous_url] = "review.php?id=$id&page=$page_previous"; $insert[review_previous] = GetTemplate("review_previous_page"); } Replace it with: Code: if ($pages > $page) { $page_next = $page + 1; $stitle = str_replace(" ","-",$insert[review_title]); $stitle = str_replace("?","",$stitle); $stitle = htmlentities($stitle); $insert[review_next_url] = $stitle."_r".$insert[review_id]."-".$page_next.".html"; $insert[review_next] = GetTemplate("review_next_page"); } if ($page > 1) { $page_previous = $page - 1; $stitle = str_replace(" ","-",$insert[review_title]); $stitle = str_replace("?","",$stitle); $stitle = htmlentities($stitle); $insert[review_previous_url] = $stitle."_r".$insert[review_id]."-".$page_previous.".html"; $insert[review_previous] = GetTemplate("review_previous_page"); } Finally, add the following mod_rewrite rule: Code: RewriteRule ^(.*)_r([0-9]+)-([0-9]+).html$ /review.php?id=$2&page=$3
Problem importing news from feed Is it possible to change the category.php?id=7 which is, for example, used for the rap music category to: category-rap-music-news.html or something similar? Secondly - will these mod-rewrite functions work with the 2.0 versions and have the same IDs on stories for instance.....or will everything change?
Problem importing news from feed Add the following mod_rewrite rule for category: Code: RewriteRule ^(.*)_c([0-9]+).html$ /category.php?id=$2 Then open the template category and add after Code: <?php global $insert; the following: Code: $ctitle = str_replace(" ","-",$insert[category_name]); $ctitle = str_replace("?","",$ctitle); $ctitle = htmlentities($ctitle); $ctitlec = $ctitle."_c".$insert[category_id].".html"; and then replace: Code: <li><a href="category.php?id=$insert[category_id]">$insert[category_name]</a> ($insert[category_news] news)<br /> with: Code: <li><a href="$ctitlec">$insert[category_name]</a> ($insert[category_news] news)<br /> The URLs changes in version 2.0, but there will be migration/redirection scripts available to allow the old (mod_rewrite) links.
Problem importing news from feed That works great on category.php... but I am also using the two column display and it isn't working right on the front of the site... I have : (template news_col_news) and... Now.. $insert[story_category] is not the same as $insert[category_name] so I changed that but it isn't working either....
Problem importing news from feed You need to change this to: Code: $ctitle = str_replace(" ","-",$insert[story_category]); $ctitle = str_replace("?","",$ctitle); $ctitle = htmlentities($ctitle); $ctitlec = $ctitle."_c".$insert[story_category_id].".html";
Problem importing news from feed *bows* Wowsers... Thanks - You're good! Wish my hosting company was as supportive as you are!
Problem importing news from feed Originally posted by Philipp: Odd, when I add this to the search page I get junk output like... = str_replace(" ","-",The Life Gift); = str_replace("?","",); = htmlentities(); = ."_s".296.".html"; I added to see if it made any difference (it didn't) : RewriteRule ^search.html$ search.php RewriteRule ^search([0-9]+).html$ search.php?cat=$1 RewriteRule ^search-([0-9]+).html$ search.php?det=$1 to the .htaccess file - where am I going wrong?
Problem importing news from feed Sounds like you put the PHP code in the HTML section. Can you post your entire search_list_news template?
Problem importing news from feed Oh bugger... yes... I put the $EST_TEMPLATE = <<<TEMPLATE BEFORE the $title etc.. should of put it after... sorry! Do I need to keep those mod-rewrite commands for the search in my .htaccess or do they make no difference?
Problem importing news from feed No, expect you want to link to your search page with search.html The other two options RewriteRule ^search([0-9]+).html$ search.php?cat=$1 and RewriteRule ^search-([0-9]+).html$ search.php?det=$1 are useless after the search function is using POST and not GET to send the data.
Problem importing news from feed Hi Philipp, How to rewrite the archive? I tried the following but didnt work out: RewriteEngine on RewriteRule ^(.*)_([0-9]+).html$ story.php?id=$2 RewriteRule ^archive_([0-9]+).html$ archive.php?id=$1&url=$2 and then in archive template i added: $sarchive = archive."_".$insert[archive_url].".html"; If i mark it like this is ok: #RewriteRule ^(.*)_([0-9]+).html$ story.php?id=$2 RewriteRule ^archive_([0-9]+).html$ archive.php?id=$1&url=$2 What do i do wrong?
Problem importing news from feed You need to change in the archive_list template: Code: <a href="archive.php?id=$insert[archive_url]"> to: Code: <a href="archive_$insert[archive_url].html"> and then adding this mod_rewrite rule: Code: RewriteRule ^archive_([0-9]+).html$ archive.php?id=$1
Problem importing news from feed Hi Philipp, Thanks for the tip. One more question: How to include the category title in meta tags. I tried: <title>$insert[page_title]$insert[category_name]</title> and <title>$insert[page_title]$insert[category_title]</title> but none of them worked. Thank you
Problem importing news from feed You need to add in the PHP part of site_header: Code: $category_name = ""; if ((preg_match("/category/",$_SERVER['PHP_SELF'])) and ($_GET['id'])) { $id = checknum($id); dbconnect(); $query = DBQuery("SELECT category_name FROM esselbach_st_categories WHERE category_id = ‘$id’"); list($category_name) = mysql_fetch_row($query); } and in the HTML part: Code: <title>$insert[page_title] $category_name</title>
Problem importing news from feed Originally posted by Philipp: I applied this and got this error: Error: 1064 You have an error in your SQL syntax near '' at line 1
Problem importing news from feed Code: $query = DBQuery("SELECT category_name FROM esselbach_st_categories WHERE category_id = ‘$id’"); should be: Code: $query = DBQuery("SELECT category_name FROM esselbach_st_categories WHERE category_id = '$id'");
Problem importing news from feed Not sure I undertsand this so much, you have edit the story news template but we can't see a story news template! Have we looked in the wrong place? We tried a couple fo thigns but still have not managed to change the structure of the URL.
Problem importing news from feed Actually, this is not a single template. You need to edit both the story and the news template.