1
cptwinky
NewBB Topic in Title
  • 2004/5/1 23:35

  • cptwinky

  • Just popping in

  • Posts: 37

  • Since: 2004/5/1 2


This is my first post here so first let me say that I love Xoops. I have used it before and did not like it (can't remember exactly what I did not like, it was a while ago) but 2.0.6 has got me hooked.

Anyways, I still do not know much about the core of this program so maybe someone could help improve this hack in some way I have yet to see...

I wanted to get the title of the forum topic to show up in the browsers title, mainly for keywords in google. Here is how I did it...

ROOT/themes/*theme name*/theme.html
Change
<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>

To...
<title><{$xoops_sitename}> - <{$xoops_pagetitle}> - <{$xoops_post_title}></title>


ROOT/modules/newbb/viewtopic.php
Add
$xoopsTpl->assign('xoops_post_title'$forumdata['topic_title']);

Before...
include XOOPS_ROOT_PATH.'/footer.php';

(*Note: There may be better placement for this in viewtopic.php but I am very unfamiliar with XOOPS at the moment and just wanted to make sure that the object was initialized before being assigned.)

I hope this does somebody good.

2
ladon
Re: NewBB Topic in Title
  • 2004/5/2 1:47

  • ladon

  • Quite a regular

  • Posts: 284

  • Since: 2003/10/31


I don't know how to improve it, because it seems te be a nice little hack doing what it should do.

Oh, one thing, the "-" is always shown, how about putting that in the smarty variable? in that case the "-" won't be shown when you're not looking at a forum thread.

3
cptwinky
Re: NewBB Topic in Title
  • 2004/5/2 1:58

  • cptwinky

  • Just popping in

  • Posts: 37

  • Since: 2004/5/1 2


Thats a good idea. Thanks.

I think this works...
<title><{$xoops_sitename}> - <{$xoops_pagetitle}><{if $xoops_post_title}> - <{$xoops_post_title}><{/if}></title>

4
djvin
Re: NewBB Topic in Title
  • 2004/9/14 22:38

  • djvin

  • Just popping in

  • Posts: 5

  • Since: 2003/4/9 1


Is it possible also for "myalbum" module to show the title of the photo??

<title><{$xoops_sitename}> - <{$xoops_pagetitle}> <{if $xoops_post_title}> - <{$xoops_post_title}><{/if}> <{if $xoops_photo_title}> - <{$xoops_photo_title}><{/if}></title>

Login

Who's Online

191 user(s) are online (99 user(s) are browsing Support Forums)


Members: 0


Guests: 191


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits