I see that page titles at Nukecops keep changing with every page. I have also used one such mode for my site, but it just shows the module folder's name in the title. Cant the mod be modified to show the custom module name, as in the module block?
_________________ It is not our abilities which decide what we truly are, it is our choices.
jib_intelli Captain
Joined: Jun 10, 2004
Posts: 338
Location: Lucknow, India
Posted:
Wed Nov 10, 2004 3:11 pm
Hmm so is there a way? I am bumping this post, maybe Evaders overlooked this!
How do I get custom module names to become dynamic page titles?
_________________ It is not our abilities which decide what we truly are, it is our choices.
Evaders99 Site Admin
Joined: Aug 17, 2003
Posts: 12342
Posted:
Wed Nov 10, 2004 4:11 pm
I honestly don't know. But since you asked for me specifically...
I'll reply on posts that I have a chance with. This one... well, it must be a feature of the NC package probably. I have no clue if its a seperate mod that can be applied to other Nukes
I asked for you specifically Evaders because you have been the first to reply to most of my post!
But please cant you find out? I need such a mod, and I have searched and searched then I posted about it at Nukecops. And even if there might not be one, can some programmer take my idea and make one?
_________________ It is not our abilities which decide what we truly are, it is our choices.
VinDSL Site Admin
Joined: Jul 08, 2003
Posts: 1193
Location: Arizona (USA) Site Admin: Lenon.com Admin: Disipal Designs
I did this to the forums on my web site, a while back, chevrons and all. When I get a chance, I'll look around and see what I changed. However, the links above will probably explain it.
I've also been developing a DMOZ 'Open Directory Project' port for PHP-Nuke. Making 'page titles' for it was quite a challenge. If all you're looking for is an example of how to generate dynamic page titles using PHP, I'll be happy to post that code here. Maybe it will give you some ideas...
/********************************************************************/
/* SN Dynamic Titles Addon */
/* =========================== */
/* by Greg Schoper */
/* http://nuke.schoper.net */
/* */
/* Based on code from PHP-Nuke */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or */
/* modify it under the terms of the GNU General Public License as */
/* published by the Free Software Foundation; either version 2 of */
/* the License. */
/********************************************************************/
/* Credit to unknown author of original forums code in */
/* includes/dynamic_titles.php. */
/********************************************************************/
But this does not help, if you visit my site, you will notice that for my custom coded modules, the title is the name of the folder of that module. But in modules administration, we can put custom module names. I want to port this dynamic titles addon to work with these custom names instead of the folder names.
If you can mod them for me. Hereis the original code>>
Code:
<?php
/********************************************************************/
/* SN Dynamic Titles Addon */
/* =========================== */
/* Copyright (c) 2003 by Greg Schoper */
/* http://nuke.schoper.net */
/* */
/* Based on code from PHP-Nuke */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or */
/* modify it under the terms of the GNU General Public License as */
/* published by the Free Software Foundation; either version 2 of */
/* the License. */
/********************************************************************/
/* Credit to unknown author of original forums code in */
/* includes/dynamic_titles.php. */
/********************************************************************/
if (eregi("dynamic_titles.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
// Item Delimeter
$item_delim = "||";
$newpagetitle = "";
global $name;
include ("config.php");
include("db/db.php");
// Catchall for anything we don't have custom coding for
if($newpagetitle==""){
$name=ereg_replace("_", " ", "$name");
$newpagetitle="$item_delim $name";
}
// If we're on the main page let's use our site slogan
if($_SERVER['REQUEST_URI']=="/index.php" || $_SERVER['REQUEST_URI']=="/"){
$newpagetitle="$item_delim $slogan";
}
// We're Done! Place the Title on the page
echo "<title>$sitename $newpagetitle</title>\n";
?>
I would be highly obliged if I could be helped.
_________________ It is not our abilities which decide what we truly are, it is our choices.
VinDSL Site Admin
Joined: Jul 08, 2003
Posts: 1193
Location: Arizona (USA) Site Admin: Lenon.com Admin: Disipal Designs
Posted:
Thu Nov 11, 2004 5:51 pm
Hrm...
'Sixone' and 'Raven' patched that code a while back. Try this version:
Sorry Vin, its the same.Could you ask Raven and Sixone to patch it to work with custom module names, which are stored in the variable $custom_title ?
_________________ It is not our abilities which decide what we truly are, it is our choices.
VinDSL Site Admin
Joined: Jul 08, 2003
Posts: 1193
Location: Arizona (USA) Site Admin: Lenon.com Admin: Disipal Designs
Posted:
Fri Nov 12, 2004 2:13 am
Heh! This is a fun script!
I just got home and started playing around with it. I see what you're saying about the custom names. For instance, I have 'Coppermine Photo Gallery' on my web site. While the module name is 'coppermine', I chose to call it 'Gallery.' However, when you click the 'Gallery' link, 'coppermine' comes up in the page title. Ugh...
This dynamic page title hack is one of those scripts, like GT, where you can get as carried away as you want, or you can keep it simple. The idea is to make SEO-friendly page titles.
In this particular instance, all I care about is that the page title says 'Gallery', not 'coppermine'. That's a no-brainer. All I have to do is add this to the script...
'coppermine' now becomes 'Gallery' in the page title...
Here's another example. I have a module called 'Docs'. However, it actually contains 'Legal Notices', so that's what I call it. To change 'Docs' to 'Legal Notices', here's what I did...
In yet another example, I wanted to retain the page titles that are being generated by the module itself. In other words, I don't want this script jacking around with the page titles being generated by the module. This is the code I used...
Last edited by VinDSL on Fri Nov 12, 2004 3:11 am; edited 1 time in total
jib_intelli Captain
Joined: Jun 10, 2004
Posts: 338
Location: Lucknow, India
Posted:
Fri Nov 12, 2004 2:30 am
Yeah! Dude you're awesome! That was exactly what I was looking for!
I think you ought to move this topic to tips and tricks and make it a sticky!
_________________ It is not our abilities which decide what we truly are, it is our choices.
SlashDot Lieutenant
Joined: Nov 22, 2004
Posts: 160
Location: Bangladesh
Posted:
Mon Dec 27, 2004 7:54 pm
well..i see all these mods and articles here. but does any of them work with nuke 7.5 and above?
i failed to make ne of them work with my 7.5
please help someone!
_________________ <b><a href="http://www.sddesign.biz">A EXCITING NEW LOOK FOR YOU PHPNUKE SITE FOR FREE?!</a></b>
<b><a href="http://www.clanthemes.biz">GIVE YOUR CLAN AN INEXPENSIVE MAKEOVER?</a></b>
jib_intelli Captain
Joined: Jun 10, 2004
Posts: 338
Location: Lucknow, India
Posted:
Mon May 09, 2005 7:21 pm
I have 7.6 and they work well with 7.6 and I have used them with 7.5 too. Could you explain your problem Slashdot?
BTW, I need it to work with $custom_title
_________________ It is not our abilities which decide what we truly are, it is our choices.
alvinhan Nuke Cadet
Joined: Sep 07, 2003
Posts: 3
Posted:
Wed May 11, 2005 1:13 pm
Thanks dude. Great info.
_________________ aLvinHan
<a href="http://www.vinsign.com/">ViNSiGN</a> Web Design
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