Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
takaharu
Client



Joined: Sep 25, 2003
Posts: 58

PostPosted: Wed Feb 09, 2005 12:40 pm Reply with quote

Hi Raven and all you other phpnuke wizards ,

I am using/building a very large encyclopedia on my site and i would like to remove the title ENCYCLOPEDIA so that only the title of the encyclopedia term is displayed in the browser window.

I am using dynamic titles and this works great for forums , news, etc... but the encyclopedia is not done. Is this possible and if yes How to do ???

Thanks a lot

_________________
Only registered users can see links on this board! Get registered or login!

Last edited by takaharu on Thu Mar 03, 2005 12:04 pm; edited 1 time in total 
View user's profile Send private message Send e-mail Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Feb 09, 2005 6:49 pm Reply with quote

In modules/Encuclopedia/languages/lang-english.php find this Define:
define("_ENCYCLOPEDIA","Encyclopedia");
Change it to
define("_ENCYCLOPEDIA","");
 
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Wed Feb 09, 2005 7:35 pm Reply with quote

http://www.nukecops.com/postlite1243-.html
Imago spent a lot of time on this some time ago getting the title to be dynamic was kind of a big deal but the code he came up with seems to be just the thing your looking for.

_________________
[b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 
View user's profile Send private message
takaharu







PostPosted: Thu Feb 10, 2005 2:20 am Reply with quote

No luck ,

I tried Ravens solution and the solution on nukecops but keep getting the ENCYCLOPEDIA title.

This is the code i included in the dynamic titles file :

Quote:
//Begin Encyclopedia title effort
if($page="index"){
$pagetitle = "Encyclopedia Terms Defined.";
if($tid){
$result = sql_query("select * from ".$prefix."_encyclopedia_text where tid = $tid", $dbi);
while($myrow = sql_fetch_array($result, $dbi))
{
$title = $myrow["title"];
}

{
$pagetitle = "Encyclopedia: $title Defined.";
}
}

}

And this is the code for the encyclopedia index file :

Quote:
find
Code:
$pagetitle = "- "._ENCYCLOPEDIA."";

and add AFTER
Code:
if($eid){
$result = sql_query("select * from ".$prefix."_encyclopedia where eid = $eid", $dbi);
while($myrow = sql_fetch_array($result, $dbi))
{

$title = $myrow["title"];
}

{
$pagetitle = "- "._ENCYCLOPEDIA." - $title";
}
}
if($tid){
$result = sql_query("select * from ".$prefix."_encyclopedia_text where tid = $tid", $dbi);
while($myrow = sql_fetch_array($result, $dbi))
{

$title = $myrow["title"];
}

{
$pagetitle = "- "._ENCYCLOPEDIA." - $title";
}
}



// End of Encyclopedia title effort


Since this post is from march 20 , 2003 i suppose this is very old code and can not work with 7.5.

Somebody cares to take a look at it and make it work ?

Thanks a lot for your time so far.
 
sixonetonoffun







PostPosted: Thu Feb 10, 2005 7:22 am Reply with quote

Is $dbi in your globals line?
 
takaharu







PostPosted: Thu Feb 10, 2005 8:17 am Reply with quote

No , i can not find any $dbi in either file
 
takaharu







PostPosted: Fri Feb 11, 2005 10:15 am Reply with quote

nobody capable to make this work ?
 
sixonetonoffun







PostPosted: Fri Feb 11, 2005 10:43 am Reply with quote

Try this in your includes/dynamic_titles.php
Might need more work but it should get you started I think.
Code:


// Encyclopedia
if($name=="Encyclopedia"){
global $db,$prefix,$eid;
$newpagetitle = "$name";
    if($eid!="") {
        $sql = "SELECT title FROM ".$prefix."_encyclopedia WHERE eid='$eid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $rev = $row[title];
        $newpagetitle = "$rev";
$newpagetitle = check_html($newpagetitle, nohtml);
    }
}
 
takaharu







PostPosted: Fri Feb 11, 2005 11:09 am Reply with quote

Great , this is getting me somewhere .

Now the encyclopedia title is shown.
Next step would be the term title.

Where can i make donations ?

Laughing Laughing Laughing Wave
 
takaharu







PostPosted: Wed Feb 16, 2005 1:22 am Reply with quote

Ok, guy's one last effort :

I got it to work with either the different encyclopedia titles or with the term titles but i would like to combine them so the dynamic titles work with both :

These are the two seperate blocks


This is the one for the different encyclopedias

// Encyclopedia
if($name=="Encyclopedia"){
global $db,$prefix,$eid;
$newpagetitle = "$name";
if($eid!="") {
$sql = "SELECT title FROM ".$prefix."_encyclopedia WHERE eid='$eid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$rev = $row[title];
$newpagetitle = "$rev";
$newpagetitle = check_html($newpagetitle, nohtml);
}
}

This is the one for the different terms

// Encyclopedia
if($name=="Encyclopedia"){
global $db,$prefix,$tid;
$newpagetitle = "$name";
if($tid!="") {
$sql = "SELECT title FROM ".$prefix."_encyclopedia_text WHERE tid='$tid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$rev = $row[title];
$newpagetitle = "$rev";
$newpagetitle = check_html($newpagetitle, nohtml);
}
}

Who can help me to combine them ?

Thanks a lot
 
takaharu







PostPosted: Wed Mar 02, 2005 12:45 pm Reply with quote

This little mod seems to atract the google bots. in 14 days over 10000 hits from google alone.

would be great to have the cat and item mod combined
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©