Author |
Message |
sixonetonoffun
Spouse Contemplates Divorce

Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Tue Jul 20, 2004 12:36 am |
|
This fixes a long standing annoyance of mine the forum titles and forum topic titles not showing in the IE browser bar. I'm sure there are other versions of this but here's mine it works with the following.
This is for phpnuke7.3 phpbb forums running Chatservs 2.5 Patche Files other will require some edits. Should work with all ports up to the current 2.1.0 with some minor edits
Simply replace the code in your modules/Forums/nukebb.php with this one.
Code:
<?php
/***************************************************************************
* phpbb2 forums port version 2.1 (c) 2003 - Nuke Cops (http://nukecops.com)
*
* Ported by Paul Laudanski (Zhen-Xjell) to phpbb2 standalone 2.0.4. Test
* and debugging completed by the Elite Nukers at Nuke Cops: ArtificialIntel,
* Chatserv, MikeM, sixonetonoffun, Zhen-Xjell. Thanks to some heavy debug
* work by AI in Nuke 6.5.
*
* You run this package at your sole risk. Nuke Cops and affiliates cannot
* be held liable if anything goes wrong. You are advised to test this
* package on a development system. Backup everything before implementing
* in a production environment. If something goes wrong, you can always
* backout and restore your backups.
*
* Installing and running this also means you agree to the terms of the AUP
* found at Nuke Cops.
*
* This is version 2.1 of the phpbb2 forum port for PHP-Nuke. Work is based
* on Tom Nitzschner's forum port version 2.0.6. Tom's 2.0.6 port was based
* on the phpbb2 standalone version 2.0.3. Our version 2.1 from Nuke Cops is
* now reflecting phpbb2 standalone 2.0.4 that fixes some major SQL
* injection exploits.
***************************************************************************/
/***************************************************************************
* This file is part of the phpBB2 port to Nuke 6.0 (c) copyright 2002
* by Tom Nitzschner (tom@toms-home.com)
* http://bbtonuke.sourceforge.net (or http://www.toms-home.com)
*
* As always, make a backup before messing with anything. All code
* release by me is considered sample code only. It may be fully
* functual, but you use it at your own risk, if you break it,
* you get to fix it too. No waranty is given or implied.
*
* Please post all questions/request about this port on http://bbtonuke.sourceforge.net first,
* then on my site. All original header code and copyright messages will be maintained
* to give credit where credit is due. If you modify this, the only requirement is
* that you also maintain all original copyright messages. All my work is released
* under the GNU GENERAL PUBLIC LICENSE. Please see the README for more information.
*
***************************************************************************/
if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
die ("You can't access this file directly...");
}
global $db, $user_prefix, $phpbb_root_path, $nuke_root_path, $nuke_file_path, $php_root_dir, $module_name, $nukename, $pass, $nukename, $name, $file;
$module_name = "Forums";
$nuke_root_path = "modules.php?name=".$module_name;
$nuke_file_path = "modules.php?name=".$module_name."&file=";
$phpbb_root_path = "modules/".$module_name."/";
$phpbb_root_dir = "./../";
require_once("mainfile.php");
get_lang($module_name);
if(isset($f)) {
$f = intval($f);
$sql="SELECT forum_name FROM ".$user_prefix."_bbforums WHERE forum_id='$f' LIMIT 0,1";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$fname = $row[forum_name];
$pagetitle = "$name-$fname:." ;
$pagetitle = check_html($pagetitle, nohtml);
}
}
if(isset($t)) {
$t = intval($t);
$sql="SELECT topic_title FROM ".$user_prefix."_bbtopics WHERE topic_id='$t' LIMIT 0,1";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$tname = $row[topic_title];
$pagetitle = "$name-$file-$tname:." ;
$pagetitle = check_html($pagetitle, nohtml);
}
}
include("header.php");
?>
|
|
_________________ [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 |
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Tue Jul 20, 2004 4:42 am |
|
Seems to work like a charm! Thanks!  |
|
|
|
 |
GanjaUK
Life Cycles Becoming CPU Cycles

Joined: Feb 14, 2004
Posts: 633
Location: England
|
Posted:
Tue Jul 20, 2004 6:06 am |
|
Nice one six
One little thing I notice, when I click on a thread from the forum block on the main nuke index.php, the title won't appear, it only appears when I go via the forum itself. Strange. |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
 |
sixonetonoffun

|
Posted:
Tue Jul 20, 2004 2:27 pm |
|
Ok since GanjaUK is whining so much about this wink* maybe he'd like to test this version which includes view profile.
Code:
<?php
if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
die ("You can't access this file directly...");
}
global $page_title, $db, $user_prefix, $phpbb_root_path, $nuke_root_path, $nuke_file_path, $php_root_dir, $module_name, $pass, $nukename, $name, $file;
$module_name = "Forums";
$nuke_root_path = "modules.php?name=".$module_name;
$nuke_file_path = "modules.php?name=".$module_name."&file=";
$phpbb_root_path = "modules/".$module_name."/";
$phpbb_root_dir = "./../";
require_once("mainfile.php");
get_lang($module_name);
if(isset($f)) {
$f = intval($f);
$sql="SELECT forum_name FROM ".$user_prefix."_bbforums WHERE forum_id='$f' LIMIT 0,1";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$fname = $row[forum_name];
$pagetitle = "$name-$fname:." ;
$pagetitle = check_html($pagetitle, nohtml);
}
}
if(isset($t)) {
$t = intval($t);
$sql="SELECT topic_title FROM ".$user_prefix."_bbtopics WHERE topic_id='$t' LIMIT 0,1";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$tname = $row[topic_title];
$pagetitle = "$name-$file-$tname:." ;
$pagetitle = check_html($pagetitle, nohtml);
}
}
if(isset($p)) {
$p = intval($p);
$sql="SELECT post_subject FROM ".$user_prefix."_bbposts_text WHERE post_id='$p' LIMIT 0,1";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$pname = $row[topic_title];
$pagetitle = "$name-$file-$pname:." ;
$pagetitle = check_html($pagetitle, nohtml);
}
}
if($name=="Forums" && $file=="profile" && $mode=="viewprofile" &&isset($u)) {
$u = intval($u);
$sql="SELECT username FROM ".$user_prefix."_users WHERE user_id='$u' LIMIT 0,1";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$uname = $row[username];
$pagetitle = "$name-$file-$mode-$uname:." ;
$pagetitle = check_html($pagetitle, nohtml);
}
}
if($name=="Forums" && $file=="index") {
$pagetitle = "$name $file";
$pagetitle = check_html($pagetitle, nohtml);
}
include("header.php");
?>
|
After the initial post here I researched the topic a little and ran into a neat addon SN Dynamic Titles Addon by Greg Schoper which uses this same approach to convert several modules. But the link to the site is down anyone know if this has been continued someplace else? It might be of interest to some of our users?
Edit: Added one more define to it wouldn't want GanjaUK to chew my arse for leaving it out! |
Last edited by sixonetonoffun on Wed Jul 21, 2004 1:41 pm; edited 1 time in total |
|
|
 |
GanjaUK

|
Posted:
Tue Jul 20, 2004 4:34 pm |
|
LOL, didn't realise I was breaking your balls so much.
Profile view, that's great. Shame my forum block doesn't agree with this. |
|
|
|
 |
Raven

|
Posted:
Tue Jul 20, 2004 11:25 pm |
|
Now kids, please play more nicely
Six, if you ever get this fixed I will include it in the 73 final  |
|
|
|
 |
sixonetonoffun

|
Posted:
Wed Jul 21, 2004 10:29 am |
|
When GanjaUK gets back I'll see if he can send me his Forum block. |
|
|
|
 |
chatserv
Member Emeritus

Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico
|
Posted:
Wed Jul 21, 2004 11:26 am |
|
As a side note i was told both the original file and the modded one have 2 instances of $nukename in the global line. |
|
|
|
 |
sixonetonoffun

|
Posted:
Wed Jul 21, 2004 1:43 pm |
|
Thanks CS I missed that completely. And edit has been made. |
|
|
|
 |
sixonetonoffun

|
Posted:
Sat Aug 07, 2004 11:55 am |
|
I never was able to find that site of Greg Schoper's so I modified the version I had using some of storebuilders suggestions if you would like to give it a try it can be found here:
http://www.netflake.com/modules.php?op=modload&name=Downloads&file=index&req=viewdownloaddetails&lid=26
I haven't added more modules but might at a later date. I focused on the forum page titles as that was the biggest problem area discussed.
I haven't tested this on GT'd sites or GT-Next-Gen sites so I'm not sure what the results will be there. |
|
|
|
 |
TheosEleos
Life Cycles Becoming CPU Cycles

Joined: Sep 18, 2003
Posts: 960
Location: Missouri
|
Posted:
Sat Aug 07, 2004 2:40 pm |
|
This is what I got from storebuilders' site. It is working great.
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.html");
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 = "$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 = "$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 = "$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= "$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= "$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 = "$name $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 = "$name $parent $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 = "$name $dl";
}
}
// Web Links
if($name=="Web_Links"){
global $l_op,$cid,$lid;
$name=ereg_replace("_", " ", "$name");
$newpagetitle = " $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 = "$name $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 = "$name $parent $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 = "$name $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 = "$page";
}
}
// Reviews
if($name=="Reviews"){
global $rop,$id;
$newpagetitle = "$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 = "$name $rev";
}
}
// Stories Archive
if($name=="Stories_Archive"){
global $sa,$year,$month_l;
$name=ereg_replace("_", " ", "$name");
$newpagetitle = "$name";
if($sa=="show_month") {
$newpagetitle = "$name $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 = "$name $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 = "$art";
}
}
// Catchall for anything we don't have custom coding for
if($newpagetitle==""){
$name=ereg_replace("_", " ", "$name");
$newpagetitle="$name";
}
// Admin Pages
if(substr($_SERVER['REQUEST_URI'], 0, 10)=="/admin.php"){
$newpagetitle="Administration for storebuilder.co.uk";
}
// If we're on the main page let's use our site slogan
if($_SERVER['REQUEST_URI']=="/index.php" || $_SERVER['REQUEST_URI']=="/"){
$newpagetitle="$slogan";
}
// We're Done! Place the Title on the page
echo "<title>$newpagetitle</title>\n";
?>
|
|
_________________ Only registered users can see links on this board! Get registered or login! |
|
 |
 |
TheosEleos

|
Posted:
Sat Aug 07, 2004 2:41 pm |
|
I wish I knew what happened to Greg. He had some nice stuff at schoper.net. |
|
|
|
 |
sixonetonoffun

|
Posted:
Sat Aug 07, 2004 4:11 pm |
|
I did include the original in the download. I might keep pecking away and come up with something a little better. I liked the other mod that allowed dynamic titles and admin configurable keywords but really I think that for the News system its a must have. I think before King Richard broke from phpnuke he had submitted such a news module and someplace along the line FB it dropped out of the distro.
We can do all this for small to medium sized sites (hack in code) but larger ones probably won't want to trade off the performance as it gets a little query intensive.
I'm open to suggestions and am willing to work with anyone on improving such a system. |
|
|
|
 |
Deseroka
Client

Joined: Apr 15, 2003
Posts: 466
Location: FL
|
Posted:
Sun Aug 08, 2004 6:43 pm |
|
And what about us poor schmucks still running 6.5 sixone?
All the cool stuff you guys are coming up with is almost enough to make me want to upgrade. |
|
|
|
 |
sixonetonoffun

|
Posted:
Sun Aug 08, 2004 7:00 pm |
|
This should be ok on 6.5 as long the Chatserv's 2.5 patches are applied to it. If not just change the lines at the begining:
if (eregi("dynamic_titles.php",$_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die();
}
to which ever of the older way you have implemented in your site.
So if the rest of your files use:
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
Just change it to be the same as the rest of your files. |
|
|
|
 |
Deseroka

|
Posted:
Sun Aug 08, 2004 7:32 pm |
|
You rock! I'm gonna try it in the morning. Stand by, coz I've been in alot of trouble here lately.
BTW, as a fair waring, I have been too timid to do Chatserv's patch. I've so many hacks and mods, I would be cross-eyed within an hour.
Neahw, sixone!  |
|
|
|
 |
sixonetonoffun

|
Posted:
Sun Aug 08, 2004 8:28 pm |
|
Good Luck I know you know how to find us if ya run into any trouble. |
|
|
|
 |
Deseroka

|
Posted:
Sun Aug 08, 2004 8:47 pm |
|
I know you sometimes wish I didn't.  |
|
|
|
 |
sixonetonoffun

|
Posted:
Thu Sep 02, 2004 4:13 pm |
|
|
|
 |
|