Author |
Message |
takaharu
Client
![](modules/Forums/images/avatars/blank.gif)
Joined: Sep 25, 2003
Posts: 58
|
Posted:
Wed Feb 09, 2005 12:40 pm |
|
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 |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Wed Feb 09, 2005 6:49 pm |
|
In modules/Encuclopedia/languages/lang-english.php find this Define:
define("_ENCYCLOPEDIA","Encyclopedia");
Change it to
define("_ENCYCLOPEDIA",""); |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
Spouse Contemplates Divorce
![](modules/Forums/images/avatars/d1ecfa674c890aee2698b.jpg)
Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Wed Feb 09, 2005 7:35 pm |
|
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 |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
takaharu
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Feb 10, 2005 2:20 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Feb 10, 2005 7:22 am |
|
Is $dbi in your globals line? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
takaharu
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Feb 10, 2005 8:17 am |
|
No , i can not find any $dbi in either file |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
takaharu
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Feb 11, 2005 10:15 am |
|
nobody capable to make this work ? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Feb 11, 2005 10:43 am |
|
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);
}
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
takaharu
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Feb 11, 2005 11:09 am |
|
Great , this is getting me somewhere .
Now the encyclopedia title is shown.
Next step would be the term title.
Where can i make donations ?
![Wave](modules/Forums/images/smiles/mexicanwave.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
takaharu
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 16, 2005 1:22 am |
|
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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
takaharu
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Mar 02, 2005 12:45 pm |
|
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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|