You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 46 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Page titles at Nukecops [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
jib_intelli
Captain
Captain


Joined: Jun 10, 2004
Posts: 338

Location: Lucknow, India

PostPosted: Mon Nov 08, 2004 6:19 pm Reply with quoteBack to top

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.

Image
Find all posts by jib_intelliView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
jib_intelli
Captain
Captain


Joined: Jun 10, 2004
Posts: 338

Location: Lucknow, India

PostPosted: Wed Nov 10, 2004 3:11 pm Reply with quoteBack to top

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.

Image
Find all posts by jib_intelliView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12372


PostPosted: Wed Nov 10, 2004 4:11 pm Reply with quoteBack to top

I honestly don't know. But since you asked for me specifically... Rolling Eyes

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

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
jib_intelli
Captain
Captain


Joined: Jun 10, 2004
Posts: 338

Location: Lucknow, India

PostPosted: Wed Nov 10, 2004 4:54 pm Reply with quoteBack to top

I asked for you specifically Evaders because you have been the first to reply to most of my post! Laughing

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.

Image
Find all posts by jib_intelliView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
VinDSL
Site Admin
Site Admin


Joined: Jul 08, 2003
Posts: 1193

Location: Arizona (USA) Site Admin: Lenon.com Admin: Disipal Designs

PostPosted: Wed Nov 10, 2004 7:37 pm Reply with quoteBack to top

These might help: Or, you can Google it: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... Wink

_________________
.:: "The further in you go, the bigger it gets!" ::.
.:: VinDSL's Lenon.com | The Disipal Site ::.
Find all posts by VinDSLView user's profileSend private messageVisit poster's websiteICQ Number
jib_intelli
Captain
Captain


Joined: Jun 10, 2004
Posts: 338

Location: Lucknow, India

PostPosted: Wed Nov 10, 2004 11:40 pm Reply with quoteBack to top

I use the followinfg for dynamic page titles>>

Quote:
/********************************************************************/
/* 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");

// Forums
if($name=="Forums"){
global $p,$t,$forum,$f;
$newpagetitle = "$name";
    if($p) {
        $sql = "SELECT post_subject, post_id FROM ".$prefix."_bbposts_text WHERE post_id='$p'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $title = $row[post_subject];
        $post = $row[post_id];

        $newpagetitle = "$name $item_delim Post $post $item_delim $title";
    }
    if($t) {
        $sql = "SELECT topic_title, forum_id FROM ".$prefix."_bbtopics WHERE topic_id='$t'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $title = $row[topic_title];
        $forum = $row[forum_id];

        $sql = "SELECT forum_name FROM ".$prefix."_bbforums WHERE forum_id='$forum'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $forum = $row[forum_name];
        $newpagetitle = "$item_delim $name $item_delim $forum $item_delim $title";
    }
    elseif($f) {
        $sql = "SELECT forum_name FROM ".$prefix."_bbforums WHERE forum_id='$f'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $forum = $row[forum_name];
        $newpagetitle = "$item_delim $name $item_delim $forum";
    }
}

// News
if($name=="News"){
global $file,$sid,$new_topic;
$newpagetitle= "$item_delim $name";
    if ($new_topic!=""){
            $sql = "SELECT topictext FROM ".$prefix."_topics WHERE topicid='$new_topic'";
                $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $top = $row[topictext];
        $newpagetitle= "$item_delim $top";
        }
    if ($file=="article"){
            $sql = "SELECT title, topic FROM ".$prefix."_stories WHERE sid='$sid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $art = $row[title];
        $top = $row[topic];
                $sql = "SELECT topictext FROM ".$prefix."_topics WHERE topicid='$top'";
                $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $top = $row[topictext];
        $newpagetitle= "$item_delim $top $item_delim $art";
    }
}

// Topics
if($name=="Topics"){
$newpagetitle = "$item_delim "._ACTIVETOPICS."";
}

// Downloads
if($name=="Downloads"){
global $d_op,$cid,$lid;
$newpagetitle = "$item_delim $name";
    if($d_op=="viewdownload") {
        $sql = "SELECT title, parentid FROM ".$prefix."_downloads_categories WHERE cid='$cid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $cat = $row[title];
        $parent = $row[parentid];
            if($parent=="0"){
                $newpagetitle = "$item_delim $name $item_delim $cat";
            }
            else{
                $sql = "SELECT title FROM ".$prefix."_downloads_categories WHERE cid='$parent'";
                $result = $db->sql_query($sql);
                $row = $db->sql_fetchrow($result);
                $parent = $row[title];
                $newpagetitle = "$item_delim $name $item_delim $parent $item_delim $cat";
            }
    }
        if($d_op=="viewdownloaddetails" || $d_op=="getit") {
            $sql = "SELECT title FROM ".$prefix."_downloads_downloads WHERE lid='$lid'";
                $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
                $dl = $row[title];
                $newpagetitle = "$item_delim $name $item_delim $dl";
        }
}

// Web Links
if($name=="Web_Links"){
global $l_op,$cid,$lid;
$name=ereg_replace("_", " ", "$name");
$newpagetitle = "$item_delim $name";
    if($l_op=="viewlink") {
        $sql = "SELECT title, parentid FROM ".$prefix."_links_categories WHERE cid='$cid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $cat = $row[title];
        $parent = $row[parentid];
            if($parent=="0"){
                $newpagetitle = "$item_delim $name $item_delim $cat";
            }
            else{
                $sql = "SELECT title FROM ".$prefix."_links_categories WHERE cid='$parent'";
                $result = $db->sql_query($sql);
                $row = $db->sql_fetchrow($result);
                $parent = $row[title];
                $newpagetitle = "$item_delim $name $item_delim $parent $item_delim $cat";
            }
    }
}

// Content
if($name=="Content"){
global $pa,$cid,$pid;
$newpagetitle = "$item_delim $name";
    if($pa=="list_pages_categories") {
        $sql = "SELECT title FROM ".$prefix."_pages_categories WHERE cid='$cid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $cat = $row[title];
        $newpagetitle = "$item_delim $name $item_delim $cat";
    }
    if($pa=="showpage") {
            $sql = "SELECT title, cid FROM ".$prefix."_pages WHERE pid='$pid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $page = $row[title];
                $cid = $row[cid];
                $sql = "SELECT title FROM ".$prefix."_pages_categories WHERE cid='$cid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $cat = $row[title];
        $newpagetitle = "$item_delim $name $item_delim $cat $item_delim $page";
        }
}

// Reviews
if($name=="Reviews"){
global $rop,$id;
$newpagetitle = "$item_delim $name";
    if($rop=="showcontent") {
        $sql = "SELECT title FROM ".$prefix."_reviews WHERE id='$id'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $rev = $row[title];
        $newpagetitle = "$item_delim $name $item_delim $rev";
    }
}

// Stories Archive
if($name=="Stories_Archive"){
global $sa,$year,$month_l;
$name=ereg_replace("_", " ", "$name");
$newpagetitle = "$item_delim $name";
    if($sa=="show_month") {
        $newpagetitle = "$item_delim $name $item_delim $month_l, $year";
    }
}

// Sections
if($name=="Sections"){
global $op,$secid,$artid;
$newpagetitle = "$item_delim $name";
    if($op=="listarticles") {
        $sql = "SELECT secname FROM ".$prefix."_sections WHERE secid='$secid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $sec = $row[secname];
        $newpagetitle = "$item_delim $name $item_delim $sec";
    }
    if($op=="viewarticle") {
            $sql = "SELECT title, secid FROM ".$prefix."_seccont WHERE artid='$artid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $art = $row[title];
                $cid = $row[secid];
                $sql = "SELECT secname FROM ".$prefix."_sections WHERE secid='$cid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $sec = $row[secname];
        $newpagetitle = "$item_delim $name $item_delim $sec $item_delim $art";
        }
}

// Catchall for anything we don't have custom coding for
if($newpagetitle==""){
    $name=ereg_replace("_", " ", "$name");
    $newpagetitle="$item_delim $name";
}

// Admin Pages
if(substr($_SERVER['REQUEST_URI'], 0, 10)=="/admin.php"){
    $newpagetitle="$item_delim Administration";
}

// 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.

Image
Find all posts by jib_intelliView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
VinDSL
Site Admin
Site Admin


Joined: Jul 08, 2003
Posts: 1193

Location: Arizona (USA) Site Admin: Lenon.com Admin: Disipal Designs

PostPosted: Thu Nov 11, 2004 5:51 pm Reply with quoteBack to top

Hrm...

'Sixone' and 'Raven' patched that code a while back. Try this version:

http://www.netflake.com/modules.php?op=modload&name=Downloads&file=index&req=viewdownloaddetails&lid=26

See what it does for you, and I'll check it out too. Looks interesting... Wink

_________________
.:: "The further in you go, the bigger it gets!" ::.
.:: VinDSL's Lenon.com | The Disipal Site ::.
Find all posts by VinDSLView user's profileSend private messageVisit poster's websiteICQ Number
jib_intelli
Captain
Captain


Joined: Jun 10, 2004
Posts: 338

Location: Lucknow, India

PostPosted: Thu Nov 11, 2004 9:00 pm Reply with quoteBack to top

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.

Image
Find all posts by jib_intelliView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
VinDSL
Site Admin
Site Admin


Joined: Jul 08, 2003
Posts: 1193

Location: Arizona (USA) Site Admin: Lenon.com Admin: Disipal Designs

PostPosted: Fri Nov 12, 2004 2:13 am Reply with quoteBack to top

Heh! This is a fun script! Very Happy

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...
Code:

// Coppermine Photo Gallery
if($name=="coppermine"){
    $customname = "Gallery";
    $newpagetitle = "$sitename $item_delim $customname";
    $newpagetitle = check_html($newpagetitle, nohtml);
}



'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...

Code:

// Legal Notices
if($name=="Docs"){
    $customname = "Legal Notices";
    $newpagetitle = "$sitename $item_delim $customname";
    $newpagetitle = check_html($newpagetitle, nohtml);
}



Simple pimple, huh?

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...

Code:

// Open Directory Project
if($name=="ODP"){
    $newpagetitle = "$sitename $pagetitle";
    $newpagetitle = check_html($newpagetitle, nohtml);
}



'$pagetitle' is the name of the string that the 'ODP' module is generating. All I am doing here is adding my web site name to it.

Dittos for the 'Forums'. I don't want this script messing with the page titles that phpBB is generating. I changed the 'Forums' section to this...

Code:

// Forums
if($name=="Forums"){
    $newpagetitle = "$sitename $pagetitle";
    $newpagetitle = check_html($newpagetitle, nohtml);
}



Is this the kind of information you were looking for? Wink

_________________
.:: "The further in you go, the bigger it gets!" ::.
.:: VinDSL's Lenon.com | The Disipal Site ::.

Last edited by VinDSL on Fri Nov 12, 2004 3:11 am; edited 1 time in total
Find all posts by VinDSLView user's profileSend private messageVisit poster's websiteICQ Number
jib_intelli
Captain
Captain


Joined: Jun 10, 2004
Posts: 338

Location: Lucknow, India

PostPosted: Fri Nov 12, 2004 2:30 am Reply with quoteBack to top

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! Wink

_________________
It is not our abilities which decide what we truly are, it is our choices.

Image
Find all posts by jib_intelliView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
SlashDot
Lieutenant
Lieutenant


Joined: Nov 22, 2004
Posts: 160

Location: Bangladesh

PostPosted: Mon Dec 27, 2004 7:54 pm Reply with quoteBack to top

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>
Find all posts by SlashDotView user's profileSend private messageVisit poster's website
jib_intelli
Captain
Captain


Joined: Jun 10, 2004
Posts: 338

Location: Lucknow, India

PostPosted: Mon May 09, 2005 7:21 pm Reply with quoteBack to top

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.

Image
Find all posts by jib_intelliView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
alvinhan
Nuke Cadet
Nuke Cadet


Joined: Sep 07, 2003
Posts: 3


PostPosted: Wed May 11, 2005 1:13 pm Reply with quoteBack to top

Thanks dude. Great info.

_________________
aLvinHan
<a href="http://www.vinsign.com/">ViNSiGN</a> Web Design
Find all posts by alvinhanView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.352 Seconds - 376 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::