Новости:

Приветствуем Вас на философском форуме!

Главное меню

Forum Titles Directory in Browser Bar

Автор Пламен, 23 сентября 2003, 11:50:35

« назад - далее »

0 Пользователи и 2 гостей просматривают эту тему.

checksum

Here it is:
<?php
/***************************************************************************
 * phpbb2 forums port version 2.1 &#40;c&#41; 2003 - Nuke Cops &#40;http&#58;//nukecops.com&#41;
 *
 * Ported by Paul Laudanski &#40;Zhen-Xjell&#41; to phpbb2 standalone 2.0.4.  Test
 * and debugging completed by the Elite Nukers at Nuke Cops&#58; 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 &#40;c&#41; copyright 2002
 *   by Tom Nitzschner &#40;tom@toms-home.com&#41;
 *   http&#58;//bbtonuke.sourceforge.net &#40;or http&#58;//www.toms-home.com&#41;
 *
 *   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&#58;//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 &#40;!eregi&#40;"modules.php", $_SERVER['PHP_SELF'&#93;&#41;&#41; &#123;
    
die &#40;"You can't access this file directly..."&#41;;
&#125;
    
global $phpbb_root_path$nuke_root_path$nuke_file_path$php_root_dir$module_name$nukename$pass$nukename;
$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&
#40;"mainfile.php"&#41;;
get_lang&#40;$module_name&#41;;

$pagetitle "$name"

   if&
#40;$p&#41; &#123; 
     
$sql "SELECT post_subject, post_id FROM ".$prefix."_bbposts_text WHERE post_id='$p'"
     
$result $db->sql_query&#40;$sql&#41;; 
     
$row $db->sql_fetchrow&#40;$result&#41;; 
     
$title $row[post_subject&#93;; 
     
$post $row[post_id&#93;; 

     
$pagetitle "$name » Post $post » $title";  
   &
#125;  

   
if&#40;$t&#41; &#123; 
     
$sql "SELECT topic_title, forum_id FROM ".$prefix."_bbtopics WHERE topic_id='$t'"
     
$result $db->sql_query&#40;$sql&#41;; 
     
$row $db->sql_fetchrow&#40;$result&#41;; 
     
$toptitle $row[topic_title&#93;; 
     
$forname $row[forum_id&#93;; 

     
$sql "SELECT forum_name, cat_id FROM ".$prefix."_bbforums WHERE forum_id='$forname'"
     
$result $db->sql_query&#40;$sql&#41;; 
     
$row $db->sql_fetchrow&#40;$result&#41;; 
     
$forname $row[forum_name&#93;; 
     
$forcat $row[cat_id&#93;; 

     
$sql "SELECT cat_title FROM ".$prefix."_bbcategories WHERE cat_id='$forcat'"
     
$result $db->sql_query&#40;$sql&#41;; 
     
$row $db->sql_fetchrow&#40;$result&#41;; 
     
$forcat $row[cat_title&#93;; 
     
$pagetitle "» $name » $forcat » $forname » $toptitle"
   &
#125; 

   
elseif&#40;$f&#41; &#123; 
     
$sql "SELECT forum_name, cat_id FROM ".$prefix."_bbforums WHERE forum_id='$f'"
     
$result $db->sql_query&#40;$sql&#41;; 
     
$row $db->sql_fetchrow&#40;$result&#41;; 
     
$forname $row[forum_name&#93;; 
     
$forcat $row[cat_id&#93;; 

     
$sql "SELECT cat_title FROM ".$prefix."_bbcategories WHERE cat_id='$forcat'"
     
$result $db->sql_query&#40;$sql&#41;; 
     
$row $db->sql_fetchrow&#40;$result&#41;; 
     
$forcat $row[cat_title&#93;; 
     
$pagetitle "» $name » $forcat » $forname"
   &
#125; 


include&#40;"header.php"&#41;;
?>



Пламен

Thank you, it's OK. So, if it is not the viewtopic.tpl, neither thr nukebb.php, the only place left is viewtopic.php.

anor1

Addon: Username In Pagetitle when viewing his/her profile (phpbb profile)

Open modules/Forums/nukebb.php and search for: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];
 $pagetitle = "|Forums | $forum";
}
After Add

elseif($u) {
 $sql = "SELECT username FROM ".$prefix."_users WHERE user_id='$u'";
 $result = $db->sql_query($sql);
 $row = $db->sql_fetchrow($result);
 $forum = $row[username];
 $pagetitle = "|Profile | $forum";
}


Upload and voila Username in page title  when viewing users profile :) (example: http://www.portedmods.com/forum-userprofile-2.html )

Пламен

Thank you, Anor. Very cool :-)

http://www.orientalia.org/member-viewprofile-741.html

But I liked very much your personal gallery. That's a real wonder. Is it your ported mod? It is by far the best to suit any needs. Are you going to share the secret? :-)

anor

This is just a little addon for the Album mod that we run i posted the code in our forums HERE Was just a simple case of copy and paste :)

Пламен

Wow, that's great! I am proud being one of the first members of your site.

The album mod is for 6.5, I presume. I don't find it in Downloads :-(

anor

Yep 6.5 and up:( We do however have a profile photo mod which allows members too upload there photo (1) too there profile for 6.0 and 6.5 and up (the one for 6.5 is somewhere in our forum :P )

Пламен

Aha, found it. Superb. I feel I'll never update to Nuke 7 :-)

anor

Addon: Extra Page (example with forum Search) In Pagetitle

Open modules/Forums/search.php and search for:if (!eregi("gate.html", $_SERVER['PHP_SELF'])) {
   die ("You can't access this file directly...");
}
if ($popup != "1"){
   $module_name = basename(dirname(__FILE__));
   require("modules/".$module_name."/nukebb.php");
}
else
{
   $phpbb_root_path = 'modules/Forums/';
}

define('IN_PHPBB', true);
Replace with

$phpbb_root_path = 'modules/Forums/';

Find:include("includes/functions_search.php");
After add:$pagetitle = "| Forum Search";
include ('header.php');


(example: http://www.portedmods.com/forums-search.html)

I just used the Forum Search as a example, this can also be applied too groupcp.php (example: http://www.portedmods.com/modules.php?name=Forums&file=groupcp]

To show the usergroups into the pagetitle:

Find:if (!eregi("gate.html", $_SERVER['PHP_SELF'])) {
   die ("You can't access this file directly...");
}
$module_name = basename(dirname(__FILE__));
require("modules/".$module_name."/nukebb.php");

define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

Replace with:
if (!eregi("gate.html", $_SERVER['PHP_SELF'])) {
   die ("You can't access this file directly...");
}
$phpbb_root_path = 'modules/Forums/';
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$pagetitle = "| UserGroups";
if($g) {
 $sql = "SELECT group_name, group_id FROM ".$prefix."_bbgroups WHERE group_id='$g'";
 $result = $db->sql_query($sql);
 $row = $db->sql_fetchrow($result);
 $title = $row[group_name];
$pagetitle = "| UserGroups | $title";
}
include ('header.php');


Example: http://www.portedmods.com/modules.php?name=Forums&file=groupcp&g=242