•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,768 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,152 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 66578 | Replies: 238
![]() |
•
•
Join Date: Oct 2004
Posts: 14
Reputation:
Rep Power: 4
Solved Threads: 0
I'm getting the same issue, but as I've been following not just the sage advice of cscgal, but also the other gurus in this thread, the links still work: however my links show up as as my tempalte is of the following structure and my .htaccess line in reference is as follows:
I don't know why this is happening, as the code definitely seems to be processing properly in all other cases.
I hope there is a solution, but for this structure of link, the links still work, they are just not showing the formatted title in the link name...
http://www.mobileforces.org/forums/f13-.html
<img class="inlineimg" src="$stylevar[imgdir_statusicon]/subforum_$forum[statusicon].gif" alt="" /> <a href="f$forum[forumid]-$forum[url].html">$forum[title]</a>
RewriteRule ^t([0-9]+)-(.*).html$ showthread.php?t=$1 [L]
I don't know why this is happening, as the code definitely seems to be processing properly in all other cases.
I hope there is a solution, but for this structure of link, the links still work, they are just not showing the formatted title in the link name...
Natcher00
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{[vB 3.0.3] HQ GFX w/- transparency for all PNG24 transparency with IE} | {[vB 3.0.3] quick and easy Gradients made easy!>vBt>} | {[vB 3.0.3] cross-browser Hover CSS effect on forumbit and threadbit>vBt>} | {DaniWeb: Learn HOW-TO mod_rewrite your vB board}
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{[vB 3.0.3] HQ GFX w/- transparency for all PNG24 transparency with IE} | {[vB 3.0.3] quick and easy Gradients made easy!>vBt>} | {[vB 3.0.3] cross-browser Hover CSS effect on forumbit and threadbit>vBt>} | {DaniWeb: Learn HOW-TO mod_rewrite your vB board}
•
•
Join Date: Sep 2004
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by macker123
Can someone help me solve a few parse errors. I was fairlr careful to make sure I did everything correct.
When I click on a thread it works fine.
When I click on a forum it works fine.
When I click on "Main Category" I get the following error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/myphotos/public_html/forum/includes/functions_forumlist.php(441) : eval()'d code on line 11
And when I goto my forums homepage I get the following error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/myphotos/public_html/forum/includes/functions_forumlist.php(441) : eval()'d code on line 5
I edited all files in notepad not dreamweaver.
If anyone could help me that would be great.
Can someone please help me with regards to this? My forum is useless as I get these errors and it needs to be launched in under 1 week.
•
•
Join Date: Oct 2004
Posts: 14
Reputation:
Rep Power: 4
Solved Threads: 0
•
•
•
•
Originally Posted by macker123
Can someone please help me with regards to this? My forum is useless as I get these errors and it needs to be launched in under 1 week.
Natcher00
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{[vB 3.0.3] HQ GFX w/- transparency for all PNG24 transparency with IE} | {[vB 3.0.3] quick and easy Gradients made easy!>vBt>} | {[vB 3.0.3] cross-browser Hover CSS effect on forumbit and threadbit>vBt>} | {DaniWeb: Learn HOW-TO mod_rewrite your vB board}
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{[vB 3.0.3] HQ GFX w/- transparency for all PNG24 transparency with IE} | {[vB 3.0.3] quick and easy Gradients made easy!>vBt>} | {[vB 3.0.3] cross-browser Hover CSS effect on forumbit and threadbit>vBt>} | {DaniWeb: Learn HOW-TO mod_rewrite your vB board}
Thanks Dani - just applied everything on a new site and everything working fine. 
However, something you may like to look at is that with user profiles, the record of posts in "find all posts by user" comes up as dynamic links, not static HTML ones. You've addressed that in your original mod_rewrite here, but it doesn't seem addressed in your latest mod - just checked out the SEO-guy forums and it's doing it there.
The concern there is simply that with static and dynamic pages listed, there's duplicated content, and I'm not sure how the search engines will deal with that issue.
Anyway...thanks you for a fine mod anyway.

However, something you may like to look at is that with user profiles, the record of posts in "find all posts by user" comes up as dynamic links, not static HTML ones. You've addressed that in your original mod_rewrite here, but it doesn't seem addressed in your latest mod - just checked out the SEO-guy forums and it's doing it there.
The concern there is simply that with static and dynamic pages listed, there's duplicated content, and I'm not sure how the search engines will deal with that issue.
Anyway...thanks you for a fine mod anyway.
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,879
Reputation:
Rep Power: 32
Solved Threads: 107
Hey there Brian
The "find all posts by user" is based on vBulletin's search feature. Therefore, it is necessary to edit the templates that vBulletin uses when you perform searches. There are two templaets involved here, as searches can display results as threads or can display results as posts.
When a search displays results as a thread, the threadbit template is used. So that is already taken care of. However, when a search displays results as a post, the template to be concerned with is search_results_postbit
This template has one occurrence of showthread.php? that will need to be updated and one occurrence of forumdisplay.php? that will need to be updated, as well.
The "find all posts by user" is based on vBulletin's search feature. Therefore, it is necessary to edit the templates that vBulletin uses when you perform searches. There are two templaets involved here, as searches can display results as threads or can display results as posts.When a search displays results as a thread, the threadbit template is used. So that is already taken care of. However, when a search displays results as a post, the template to be concerned with is search_results_postbit
This template has one occurrence of showthread.php? that will need to be updated and one occurrence of forumdisplay.php? that will need to be updated, as well.
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
Join Date: Oct 2004
Posts: 14
Reputation:
Rep Power: 4
Solved Threads: 0
RE: Who's Online Full Solution
OK - I followed your later post about this issue, and took it to the nth degree:
There are a couple of things to do here:
•
•
•
•
Originally Posted by YoungCoder
When somebody visits thread(threadid).html it shows up as an unknown location on online.php, how can i fx this? I cant add an entry as i am unsure how to get it to work as the id is acctually part of the filename...
There are a couple of things to do here:
- in includes/functions_online.php, add a new function:[php]function mod_rewrite_title($title)
{
$rewritten = strtolower(str_replace(" ", "-",str_replace("/", "-", $title)));
return ereg_replace("[/?!.
%£()~*@]+", "", $rewritten);
}
[/php] - Then, find:[php] convert_short_varnames($values);
$userinfo['values'] = $values;
[/php] - Add below:[php] if (eregi("t([0-9]+)-(.*).html$", $filename, $tmatch))
{
$filename = 'showthread.php';
$values['threadid'] = $tmatch[1];
}
if (eregi("f([0-9]+)-(.*).html$", $filename, $fmatch))
{
$filename = 'forumdisplay.php';
$values['forumid'] = $fmatch[1];
}
if (eregi("post([0-9]+).html$", $filename, $pmatch))
{
$filename = 'showthread.php';
$values['postid'] = $pmatch[1];
}
[/php] - NOTE: in this above addition, you MUST alter the thread, forum and post rewrite statements to match those in your htaccess!
- Now, search for every instance of [php]$userinfo['where'][/php] which refers to the three $filename instances above and alter the <a href="... statement to match the rewritten display of your URLs...
examples[php]$userinfo['where'] = "<a href=\"f$forumid-" . mod_rewrite_title($forumtitle) . ".html\">$forumtitle</a>";
$userinfo['where'] = "<a href=\"t$forumid-" . mod_rewrite_title($threadtitle) . ".html\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"post$postid.html#postid=$postid\" title=\"$threadpreview\">$threadtitle</a>";[/php]
Natcher00
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{[vB 3.0.3] HQ GFX w/- transparency for all PNG24 transparency with IE} | {[vB 3.0.3] quick and easy Gradients made easy!>vBt>} | {[vB 3.0.3] cross-browser Hover CSS effect on forumbit and threadbit>vBt>} | {DaniWeb: Learn HOW-TO mod_rewrite your vB board}
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{[vB 3.0.3] HQ GFX w/- transparency for all PNG24 transparency with IE} | {[vB 3.0.3] quick and easy Gradients made easy!>vBt>} | {[vB 3.0.3] cross-browser Hover CSS effect on forumbit and threadbit>vBt>} | {DaniWeb: Learn HOW-TO mod_rewrite your vB board}
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,879
Reputation:
Rep Power: 32
Solved Threads: 107
Too complicated for me, Natch!
That's why I never bothered hehe.
That's why I never bothered hehe. Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
Join Date: Oct 2004
Posts: 14
Reputation:
Rep Power: 4
Solved Threads: 0
Heh: I know what you mean, but as my board is just as much an experiment of mine as a active forum, I can afford to screw up once in a while 
This last bit in my post above can be broken up into two parts:
One part makes the Who's online refer to the right link name (adding the code just below [php]convert_short_varnames($values);
$userinfo['values'] = $values; [/php])
The rest of the mod is what's required to force the links to be links to the rewritten URI's not the showthread.php/forumdisplay.php links, etc

This last bit in my post above can be broken up into two parts:
One part makes the Who's online refer to the right link name (adding the code just below [php]convert_short_varnames($values);
$userinfo['values'] = $values; [/php])
The rest of the mod is what's required to force the links to be links to the rewritten URI's not the showthread.php/forumdisplay.php links, etc
Natcher00
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{[vB 3.0.3] HQ GFX w/- transparency for all PNG24 transparency with IE} | {[vB 3.0.3] quick and easy Gradients made easy!>vBt>} | {[vB 3.0.3] cross-browser Hover CSS effect on forumbit and threadbit>vBt>} | {DaniWeb: Learn HOW-TO mod_rewrite your vB board}
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{[vB 3.0.3] HQ GFX w/- transparency for all PNG24 transparency with IE} | {[vB 3.0.3] quick and easy Gradients made easy!>vBt>} | {[vB 3.0.3] cross-browser Hover CSS effect on forumbit and threadbit>vBt>} | {DaniWeb: Learn HOW-TO mod_rewrite your vB board}
•
•
Join Date: Oct 2004
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by maverickrd
Hello,
i have a prob with the sub-forums it looks lite "Forumname".html and the link dont work.
Have somebody a idea!
CU
Mav
Hello at all,
now i got it, so can somebody rewrite this hack, so can everybody do this hack on a forum.
A new Manual are be good!
But great Work to dany and all other coder here.
Best Regards
mav
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
- [Revised] vBulletin Mod_rewrite Tutorial (PHP)
- vBulletin mod_rewrite for vB 3.0.7 (Existing Scripts)
- vBulletin mod_rewrite for vB 3.0.7 (Growing an Online Community)
- vBulletin mod_rewrite in phpBB mod format (Existing Scripts)
Other Threads in the PHP Forum
- Previous Thread: Help Needed
- Next Thread: mysql_num_rows warning



Linear Mode