Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
NoFantasy
Newbie
Newbie



Joined: Nov 01, 2006
Posts: 10

PostPosted: Thu Dec 14, 2006 4:12 pm Reply with quote

You have some cool stuff happening when a user hists the View Last Post-image in any forums list. The 50 first chars appearing as the title and make it appear as a unique title! I want it, lol

So far i got:
Code:
if(isset($p)) {
$p = intval($p);
$sql="SELECT post_text FROM ".$prefix."_bbposts_text WHERE post_id='$p' LIMIT 0,1";
$result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
$pname = substr($row['post_text'], 0, 55);
$pname = check_html($pname, "nohtml");
$pagetitle = "- $pname" ;
$pagetitle = check_html($pagetitle, "nohtml");
}
}

include("header.php");
?>

...at the bottom of the ../modules/Forums/nukebb.php to achieve this.
Do you have any custom made function to strip out any not-wanted stuff in the title, like the [ quote : xxxxxxx-thingies?
 
View user's profile Send private message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 401

PostPosted: Thu Dec 14, 2006 9:34 pm Reply with quote

I think this may be part of the Dynamic Titles mode
 
View user's profile Send private message
NoFantasy
Newbie
Newbie



Joined: Nov 01, 2006
Posts: 10

PostPosted: Fri Dec 15, 2006 8:39 am Reply with quote

Ah, yeah that might be it...i never did get that right for the forums, however the above code seems to work just fine with me.

I would like to get rid of any BBcode though...any ideas?
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1393

PostPosted: Fri Dec 15, 2006 8:44 am Reply with quote

Try something like this:

$pagetitle = preg_replace("/\[(\S+)\]/e", "", $pagetitle);

And do this right before your final "check_html" line.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
NoFantasy
Newbie
Newbie



Joined: Nov 01, 2006
Posts: 10

PostPosted: Fri Dec 15, 2006 1:09 pm Reply with quote

Nice...works just great, thanks alot Very Happy
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1393

PostPosted: Sat Dec 16, 2006 9:57 am Reply with quote

You are welcome.

BTW, I took that directly out of the Dynamic Titles code. I need to release what I have incorporated into the upcoming RavenNuke 2.10 release so that others can get this as well. Maybe today...

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
NoFantasy
Newbie
Newbie



Joined: Nov 01, 2006
Posts: 10

PostPosted: Sun Dec 17, 2006 6:25 am Reply with quote

Hm, i don't have that sort of code in my dynamic titles file. I'm guessing an old version. Didn't find an updated file here nor at raven's, so i try to sit still a few days, waiting for the goodies to come, lol
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch