My changes are working on index.php for forum titles with question marks in them, but it's not stripping question marks from the nav. Any suggestions?

I'm also still trying to sort out changes to my .htaccess that will permit me to incorporate the forum title as a pseudo-directory, like so:

http://[domain]/forums/[forum_title]/t123-[thread_title].html

I tried adding:

RewriteRule ^(.*)/(t([0-9]+)-(.*).html$ showthread.php?t=$2 [L]

But this breaks the forums entirely... every page generates a 404 error. Any suggestions?

There's still a bug with forum titles that use a question mark. Any ideas?

Hi guys great md I have it up and running over at www.rebreatherworld.com and It works a treat..

what I am trying to do now is to change one of my mods on the front page which shows the last 10 threads that have been active.

I have it half working in that it shows the thread number in .html format but it does not show the thread title in the link.

I now I need this code in there

Quote:
// added by keith
$thread = strtolower(str_replace(" ", "-", $thread));
$thread = ereg_replace("[/?!.$%£()~*@]+", "", $thread);
// added by keith


but I can not work out where it shoudl go....I have tried a few places in the .php file which generates it The code for that file is

Quote:
<?php
// ++================================================ =========================++
// || vBadvanced CMPS 1.0.0 ||
// || © 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved ||
// || This file may not be redistributed in whole or significant part. ||
// || http://vbadvanced.com ||
// ++ ================================================== ======================++

// ######################### Latest Forum Topics #########################
if ($vba_options)
{

$inforums = '';

if ($vba_options)
{
if (!empty($forumperms))
{
$inforums = array();
$threadsforums = explode(',', $vba_options);
foreach ($threadsforums AS $tforum)
{
if (!in_array($tforum, $forumperms))
{
$inforums[] = $tforum;
}
}
if (!empty($inforums))
{
$inforums = implode(',', $inforums);
}
}
else
{
$inforums = $vba_options;
}
if ($inforums)
{
$inforums = 'AND thread.forumid IN (' . $inforums . ')';
}
}

$foruminfo = $vba_options;

$show = $vba_options;

if ($vba_options AND $bbuserinfo)
{
$query = ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed';
$query = 'LEFT JOIN ' . TABLE_PREFIX . 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = ' . $bbuserinfo . ')';
}

if ($vba_options AND $vboptions)
{
$query = ', post.pagetext AS preview';
$query = 'LEFT JOIN ' . TABLE_PREFIX . 'post AS post ON (post.postid = thread.firstpostid)';
}

if ($vba_options)
{
$query = ',thread.forumid, forum.title AS forumtitle';
$query = 'LEFT JOIN ' . TABLE_PREFIX . 'forum AS forum ON (thread.forumid = forum.forumid)';
}

if ($vba_options)
{
$query = ', thread.iconid AS threadiconid, iconpath AS threadiconpath';
$query = 'LEFT JOIN ' . TABLE_PREFIX . 'icon USING (iconid)';
}

$threads = $DB_site->query("
SELECT
" . iif($vba_options, 'IF(votenum >= ' . $vboptions . ', votenum, 0) AS votenum, IF(votenum >= ' . $vboptions . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . "
thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid
$query[iconfields]
$query[forumfields]
$query[previewfields]
$query[subfields]
FROM " . TABLE_PREFIX . "thread as thread
$query[iconjoin]
$query[forumjoin]
$query[previewjoin]
$deljoin
$query[subjoin]
WHERE open <> '10' AND thread.visible = 1 $iforumperms $inforums $notdeleted
ORDER BY lastpost DESC
LIMIT $vba_options[portal_threads_maxthreads]
");

while ($thread = $DB_site->fetch_array($threads))
{
if (strlen($thread) > $vba_options AND $vba_options)
{
$thread = fetch_trimmed_title($thread, $vba_options);
}

$thread = process_thread_array($thread, '', $vba_options);

$getbgrow = getrowcolor();

eval('$threadbits .= "' . fetch_template('adv_portal_latesttopicbits') . '";');
}

eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_latesttopics') . '";');

$DB_site->free_result($threads);
unset($thread, $threadbits, $foruminfo, $query, $inforums);
}

If anyoen could tell me what to put in where would be VERY greatful.

thanks

Stuart

Nice tutorial, however, i think the original poster should update the first post with the tips and fixes posted by the fellow members... this will help people that add this hack to their forums for the first time... they will not need to read the whole thread for fixes.. just a suggestion because that is what I did..I had to go trough all the thread the good thing is that the thread is only 5 pages long right now, but I think this thread will grow even bigger...

Good suggestion! I'd also like to hear if anyone has ideas on the question-mark-in-forum-title bug.

a small question which mod_rewrite code is more effecient ?
from cscgal or KeithMcL ?

Regards,

if csgal's doesnt use the forum/thread titles in the filename.html, this one from KeithMCL is.

also on another note: Keith, why dont you update your first post to fix all the errors you made? such as missing \ in some of the find and edit lines.

Just wondering if the first thread has been updated yet?
If not Dani please could u?

Also, can anyone give me code changes to make this mod only affect 'guests' or non logged in users? It would make sense right? Seeing that its whole purpose is for better spidering abilities (therefore not needed for logged in users).

Anyone agree?

Here is how to get the latest topics block in vbadvanced to use the new rewritten urls....
You can see this working at http://www.accringtonweb.com

Edit the modules/latesttopics.php file.
in modules/latesttopics.php
Find:

$thread = process_thread_array($thread, '', $vba_options['portal_threads_showicon']);

Below Add:

// ################ MOD_REWRITE HACK ######################
               $thread['url'] = strtolower(str_replace(" ", "-", $thread['title']));
               $thread['url'] = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $thread['url']);
        // ################ MOD_REWRITE HACK ######################

Now you just have to edit the adv_portal_latesttopicbits template.

Template Edits:

adv_portal_latesttopicbits

Find: (2 instances)

showthread.php?t=$thread[threadid]

Replace with:

t$thread[threadid]-$thread[url].html

I get the following error though when i click on member name:
Parse error: parse error, unexpected T_STRING in /hsphere/local/home/vikram/thalforum.com/forums/includes/functions_online.php on line 653


and following error when I click on "whose Online"

Parse error: parse error, unexpected T_STRING in /hsphere/local/home/myforum.com/forums/includes/functions_online.php on line 653

Fatal error: Call to undefined function: sanitize_perpage() in /hsphere/local/home/myforum.com/forums/online.php online 78

=============
im not sure if this is related but in my functions_online.php I had the following code..
<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\">$forumtitle</a>

and i replaced it with

"<a href=\"f$forumid-" .mod_rewrite_title($forumtitle). ".html\">$forumtitle</a>";

keeping the ( \ ) backslash as instructed.


Would anyone know what cud be going wrong? ur help will be appreciated.

thanks

Sorry to sound a little anxious but I would really appreciate any help on the issue ^^^^^^^^^^^^^^^^. :D

this was a nice tutorial...
I tried to implement this following the steps in the documents....

I am getting a blank page when i click on main form..

http://www.collectingforum.org

can u pls figure out did i do anything wrong ? Is there any other modifcation needed except the first page document ?

pls tell me a suggestion....

Unfortunately, it seems these tutorials have gotten out of hand. The original posts had some bugs in them that were fixed in the many subsequent posts. Without someone taking the time to consolidate them into the original, people will continue to have problems implementing.

Alas it is for phpBB

Nono! It's the same vBulletin mod_rewrite tutorial, but written in phpBB mod documentation / tutorial format.

Hi folks, i finally got this going .. works great.. for all new posts.

Congrats, Tdot :) Do you have any recommendations for those folks who would like to get started but are overwhelmed by which tutorial to follow and which posts have bug fixes, etc?

Alas it is for phpBB

Actually, it's not for phpBB, it's just re-written in the mod format of phpBB.

It's still for vBulletin, just written differently so it's easier to understand (for some)

Do you have any recommendations for those folks who would like to get started but are overwhelmed by which tutorial to follow and which posts have bug fixes, etc?

That's what I'm waiting to hear as well.

There seems to be 3 (or more) different versions posted here, and I'm eager to get one going on my forum, but I don't know which one is "good" and has all the bugfixes that people reported.

That's what I'm waiting to hear as well.

There seems to be 3 (or more) different versions posted here, and I'm eager to get one going on my forum, but I don't know which one is "good" and has all the bugfixes that people reported.

Hi,

I have Dani's working with vB 3.0.5 (patched). Thanks Dani! I think Gandalf's version helps tremendously especially for those of us used to implementing phpBB2 mods.

I have two questions:

1) Can someone who implemented Ted/Keith's do the same thing for their versions?

2) I am concerned that Ted/Keith's version will mess up my thread URLs IF the title has a sign (e.g., ?, !, -, or ...). Does anyone know if this is true? If it isn't, I will be glad to implement Ted/Keith's and post the way to do it in phpBB2 mod format.

Thanks!

Hi,

I have Dani's working with vB 3.0.5 (patched). Thanks Dani! I think Gandalf's version helps tremendously especially for those of us used to implementing phpBB2 mods.

I have two questions:

1) Can someone who implemented Ted/Keith's do the same thing for their versions?

2) I am concerned that Ted/Keith's version will mess up my thread URLs IF the title has a sign (e.g., ?, !, -, or ...). Does anyone know if this is true? If it isn't, I will be glad to implement Ted/Keith's and post the way to do it in phpBB2 mod format.

Thanks!

that would be good thanks!

Perhaps we should petition vbulletin.org and ask them to create a standard format that all mod/hack submitters must adhere to? its one of the things I wondered why already isnt in place!

Congrats, Tdot :) Do you have any recommendations for those folks who would like to get started but are overwhelmed by which tutorial to follow and which posts have bug fixes, etc?

Hi cscgal and everyone else.. i have a good news and bad news.

good news first - I got this mod installed properly... all i did was to follow the instructions.. it was a little complicated but in the end.. the mod installed with no errors. I have more 50 mods installed on my forums so just take some extra care while installing this one..


Om the bad news - I checked my forums using a spider simulator and it is picking up html pages but reporting it as broken.

My forums are installed in myforums.com/forums directory

and the spider is connecting to URL
http://www.my forums.com/f2-thalassemia.html

instead of connecting to: http://www.my forums.com/FORUMS/f2-thalassemia.html


the FORUMS part is missing in URLs.

Can anyone here shed light on how i can fix that problem..... Please do, because then this mod will work like a CHARM!!!!!

i have a feeling, i need to edit a .htaccess file to fix this... but my knowledge is very poor... all i need is to tell the spidy to add "forums" before threads.

Dani,

How did you get your Who's Online to look the way it does? Mine looks like:
Unknown Location /forumapc/thread5898.html after implementing your mod.

Tdot,

Are you using the .htaccess as contained in the posts or the original tutorial. The one in the original (revised) tutorial is wrong.

Nice writeup! Thank you, I have just one question.

I run a couple dozen skins on my site, but Guests (and spiders) can only use one - the default. If I make these changes, can I only modify the default skin's templates and all the others will continue to work properly without having to modify each one?

Nice writeup! Thank you, I have just one question.

I run a couple dozen skins on my site, but Guests (and spiders) can only use one - the default. If I make these changes, can I only modify the default skin's templates and all the others will continue to work properly without having to modify each one?

It would be nice if this could be changed to affect guests ONLY - dont see the need for it to be used for logged in users...
(thats how the one I used for my phpbb worked)

It would be nice if this could be changed to affect guests ONLY - dont see the need for it to be used for logged in users...
(thats how the one I used for my phpbb worked)

I would be concerned about too many unnessary conditionals; my site runs about 600+ users online at a time. Thats why I force guests to use a lightweight skin versus one that a member can select. Since this is mainly a Google thing, either I make a template just for spiders or I use the lightweight one.

As long as no variables are being rewritten and only new ones are being used, I dont think this would be a problem.

One issues I've encountered is the changing of styles. It's trying to add the ?styleid=XX onto the .html page call and the rewrite is not passing any additional variables to the script.

Tdot,

Are you using the .htaccess as contained in the posts or the original tutorial. The one in the original (revised) tutorial is wrong.

oh! is that rite?

thanks Agiacosa, i will try the old one out and post the results here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.