xoops forums

bjbtexas

Not too shy to talk
Posted on: 2004/12/8 0:53
bjbtexas
bjbtexas (Show more)
Not too shy to talk
Posts: 106
Since: 2004/7/3 2
#1

Title Tag Hack

Is there a title tage hack that is universal to all modules?

Is there a title tag hack for News and xDirectory?

script_fu

Friend of XOOPS
Posted on: 2004/12/8 1:03
script_fu
script_fu (Show more)
Friend of XOOPS
Posts: 1494
Since: 2002/12/27
#2

Re: Title Tag Hack

The (Theme Changer) module would be the best for this...
Look in the module repository.

bjbtexas

Not too shy to talk
Posted on: 2004/12/19 23:43
bjbtexas
bjbtexas (Show more)
Not too shy to talk
Posts: 106
Since: 2004/7/3 2
#3

Re: Title Tag Hack

Thanks, but I am looking for something like what is in AMS module to put in the xDirectory.

$xoopsTpl->assign('xoops_pagetitle'$myts->makeTboxData4Show($xoopsModule->name()) . ' - ' $myts->makeTboxData4Show($article->title()));


I want to append the title tag with an individual page name.

bjbtexas

Not too shy to talk
Posted on: 2005/1/26 0:18
bjbtexas
bjbtexas (Show more)
Not too shy to talk
Posts: 106
Since: 2004/7/3 2
#4

Re: Title Tag Hack

I finally found it!

I read about it on a Chinese site (using Google translations) It referred me to the French XOOPS site, but I couldn’t find it there, but I did find it here:

http://www.herve-thouzard.com/modules ... 7&lid=66&sel_lang=english


It adds the page title to every page in these directories:

Mydownloads
Mylinks
Newbb
News
Sections
Soapbox
Xoopsfaq
Xoopsheadline
Xoopspartners
Xoopspoll

I’ve made it work for xDirectory if anyone wants it let me know and I’ll put it on my site. The title gets a little long, so I cut it down to the site name and the singlelink.php page title. If any one knows how I could make it just the singlelink.php page title removing the site name I’d appreciate the help.

Thanks,

jayjay

Not too shy to talk
Posted on: 2005/1/26 10:11
jayjay
jayjay (Show more)
Not too shy to talk
Posts: 175
Since: 2003/9/10
#5

Re: Title Tag Hack

Hi bjbtexas!

Great work!

I'm interested in your title hack for xdirectory. Can you post it on xoops.org so that everyone can benefit from it?

I just posted a title tag hack for wfdownloads myself, but I feel lazy today so if you have a solution for xdirectory...

rudycash

Just popping in
Posted on: 2005/1/26 10:29
rudycash
rudycash (Show more)
Just popping in
Posts: 70
Since: 2004/2/12
#6

Re: Title Tag Hack

I need the Hack for Xdirectory aswell.

Isn't it about time we had SEF URL's for XOOPS like mambo?

bjbtexas

Not too shy to talk
Posted on: 2005/1/26 15:42
bjbtexas
bjbtexas (Show more)
Not too shy to talk
Posts: 106
Since: 2004/7/3 2
#7

Re: Title Tag Hack

Here is the code changes for the singlelink.php added at line 88 in xDirectory:
// // Page Title Hack by Xoops-France copied from mylinks by bjb@advenquest.com 1/25/05
$title="";
if(
$cid>0)
{
    
$sql "SELECT title FROM ".$xoopsDB->prefix("xdir_cat")." t where cid=$cid";
    
$result=$xoopsDB->query($sql,$show,$min);
    
$myrow $xoopsDB->fetchArray($result);
    
$title=' - '  $myts->makeTboxData4Show($myrow['title']);
}
$xoopsTpl->assign('xoops_pagetitle'$myts->makeTboxData4Show($ltitle)); // Shortened by bjb@advenquest.com 1/25/05 from  $xoopsTpl->assign('xoops_pagetitle', $myts->makeTboxData4Show($xoopsModule->getVar('name')). $myts->makeTboxData4Show($title).' - '.$myts->makeTboxData4Show($ltitle));
// Page Title Hack by Xoops-France copied from mylinks by bjb@advenquest.com 1/25/05


The rest are availiable
here see it working in Adventure Directory

jayjay

Not too shy to talk
Posted on: 2005/1/27 9:09
jayjay
jayjay (Show more)
Not too shy to talk
Posts: 175
Since: 2003/9/10
#8

Re: Title Tag Hack

You can put almost the exact same code in viewcat.php to show category titles in xdirectory:

$title="";
if(
$cid>0)
{
$sql "SELECT title FROM ".$xoopsDB->prefix("xdir_cat")." t where cid=$cid";
$result=$xoopsDB->query($sql,$show,$min);
$myrow $xoopsDB->fetchArray($result);
$title=$myts->makeTboxData4Show($myrow['title']);
}

$xoopsTpl->assign('xoops_pagetitle'$title.' | '.$myts->makeTboxData4Show($xoopsModule->getVar('name')));


I added this around line 90 just above this line:

if ($xoopsModuleConfig['useshots'] == 1) {


Have fun!

bjbtexas

Not too shy to talk
Posted on: 2005/1/27 19:37
bjbtexas
bjbtexas (Show more)
Not too shy to talk
Posts: 106
Since: 2004/7/3 2
#9

Re: Title Tag Hack

How did you change the order, so the page title is before the site title?

bjbtexas

Not too shy to talk
Posted on: 2005/1/27 23:11
bjbtexas
bjbtexas (Show more)
Not too shy to talk
Posts: 106
Since: 2004/7/3 2
#10

Re: Title Tag Hack

Never mind I figured it out,

<title> <{$xoops_pagetitle}> | <{$xoops_sitename}></title>


I changed the title tag order in my theme.

This should vault me to the top of Google any minute now!

Thank you for the insipration JayJay. You have very nice site!