[MODDB]Categories hierarchy - sub-forums v2.1.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
kraikon1
Registered User
Posts: 2
Joined: Sun Dec 12, 2004 3:37 pm

Post by kraikon1 » Sun Dec 19, 2004 11:49 am

also in this file includes/functions_post.php

this is what they ask for change

Code: Select all

#
#-----[ FIND ]------------------------------------------------
#

	$sql = "SELECT emoticon, code, smile_url   
		FROM " . SMILIES_TABLE . " 
		ORDER BY smilies_id";

#
#-----[ REPLACE WITH ]----------------------------------------
#

	$sql = "SELECT emoticon, code, smile_url
		FROM " . SMILIES_TABLE . $where . "
		ORDER BY smilies_order ASC";

#


#
#-----[ FIND AND DELETE ]-------------------------------------
#
# NOTE: Reason for the deletion is that it's now in the generate_categories() function.
#

			if ($mode == 'inline' && $num_smilies > $inline_rows * $inline_columns)
			{
				$template->assign_block_vars('switch_smilies_extra', array());

				$template->assign_vars(array(
					'L_MORE_SMILIES' => $lang['More_emoticons'], 
					'U_MORE_SMILIES' => append_sid("posting.$phpEx?mode=smilies"))
				);
			}

#
#-----[ FIND ]------------------------------------------------
#

} //End generate_smilies()

# 
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Smiley Categories Mod
function generate_categories()
{
	global $db, $board_config, $template, $phpEx, $lang;

	$cat_min = $board_config['smilie_cat_min'];
	$show_smilie_cat_name = $board_config['show_smilie_cat_name'];

	$template->set_filenames(array(
		'body' => 'posting_body.tpl')
	);

	// Select categories that are not hidden or empty.
	$sql = "SELECT * FROM " . SMILIES_CAT_TABLE . "
		WHERE hidden != 1 AND smilies_total >= 1
		ORDER BY cat_order ASC";
	$result = $db->sql_query($sql);
	$total_cats = $db->sql_numrows($result);

	if ($total_cats >= $cat_min)
	{
		$num_cats = 1;
		$rowset = array();
		while ($row = $db->sql_fetchrow($result))
		{
			if (empty($rowset[$row['cat_name']]))
			{
				$rowset[$row['cat_name']]['description'] = $row['description'];
				$rowset[$row['cat_name']]['cat_order'] = $row['cat_order'];
			}
		}

		$template->assign_block_vars('category_buttons', array());

		$template->assign_vars(array(
			"L_BBCODE_CAT_TITLE" => $lang['cat_title_bbcode'])
		);

		while (list($cat_name, $data) = @each($rowset))
		{
			$template->assign_block_vars('category_help', array(
				'NAME' => 'cat'.$num_cats,
				'HELP' => $data['description'])
			);

			$name_or_number = ($show_smilie_cat_name == 1) ? $cat_name : $num_cats;

			$template->assign_block_vars('category_buttons.categories', array(
				'NUMBER' => $name_or_number,
				'NAME' => 'cat'.$num_cats,
				'CAT_MORE_SMILIES' => append_sid("posting.$phpEx?mode=smilies").'&cat='.$data['cat_order'])
			);
			$num_cats++;
		}

	}
	else
	{
		$template->assign_block_vars('switch_smilies_extra', array());

		$template->assign_vars(array(
			'L_MORE_SMILIES' => $lang['More_emoticons'], 
			'U_MORE_SMILIES' => append_sid("posting.$phpEx?mode=smilies"))
		);
	}
}
// End Smiley Categories Mod


but this is what i have in the file right now

Code: Select all

//-- mod : categories hierarchy ------------------------------------------------
//-- delete
//	$sql = "SELECT emoticon, code, smile_url   
//		FROM " . SMILIES_TABLE . " 
//		ORDER BY smilies_id";
//	if ($result = $db->sql_query($sql))
//	{
//		$num_smilies = 0;
//		$rowset = array();
//		while ($row = $db->sql_fetchrow($result))
//		{
//			if (empty($rowset[$row['smile_url']]))
//			{
//				$rowset[$row['smile_url']]['code'] = str_replace("'", "\\'", str_replace('\\', '\\\\', $row['code']));
//				$rowset[$row['smile_url']]['emoticon'] = $row['emoticon'];
//				$num_smilies++;
//			}
//		}
//-- add
	// set a "if (true) {" only for the last "}" at bottom
	if ( true )
	{
		global $smilies;

		$data = $smilies->read();
		$count_data = count($data);
		$rowset = array();
		$num_smilies = 0;
		for ($i = 0; $i < $count_data; $i++ )
		{
			$row = $data[$i];
			if (empty($rowset[$row['smile_url']]))
			{
				$rowset[$row['smile_url']]['code'] = str_replace("'", "\\'", str_replace('\\', '\\\\', $row['code']));
				$rowset[$row['smile_url']]['emoticon'] = $row['emoticon'];
				$num_smilies++;
			}
		}
//-- fin mod : categories hierarchy --------------------------------------------

		if ($num_smilies)
		{
			$smilies_count = ($mode == 'inline') ? min(19, $num_smilies) : $num_smilies;
			$smilies_split_row = ($mode == 'inline') ? $inline_columns - 1 : $window_columns - 1;

			$s_colspan = 0;
			$row = 0;
			$col = 0;

			while (list($smile_url, $data) = @each($rowset))
			{
				if (!$col)
				{
					$template->assign_block_vars('smilies_row', array());
				}

				$template->assign_block_vars('smilies_row.smilies_col', array(
					'SMILEY_CODE' => $data['code'],
					'SMILEY_IMG' => $board_config['smilies_path'] . '/' . $smile_url,
					'SMILEY_DESC' => $data['emoticon'])
				);

				$s_colspan = max($s_colspan, $col + 1);

				if ($col == $smilies_split_row)
				{
					if ($mode == 'inline' && $row == $inline_rows - 1)
					{
						break;
					}
					$col = 0;
					$row++;
				}
				else
				{
					$col++;
				}
			}

			if ($mode == 'inline' && $num_smilies > $inline_rows * $inline_columns)
			{
				$template->assign_block_vars('switch_smilies_extra', array());

				$template->assign_vars(array(
					'L_MORE_SMILIES' => $lang['More_emoticons'], 
//-- mod : categories hierarchy ------------------------------------------------
//-- delete
//					'U_MORE_SMILIES' => append_sid("posting.$phpEx?mode=smilies"))
//				);
//-- add
					'U_MORE_SMILIES' => $config->url('posting', array(POST_FORUM_URL => $forum_id, 'mode' => 'smilies'), true),
				));
//-- fin mod : categories hierarchy --------------------------------------------

cesa
Registered User
Posts: 11
Joined: Tue Nov 30, 2004 6:47 pm

Post by cesa » Sun Dec 19, 2004 11:52 am

cesa wrote:
Ptirhiik - RPGnet-fr wrote: > cesa: noted, (with reference to)

just in case to have been forgotten :wink:

:D

the_bunny
Registered User
Posts: 194
Joined: Wed Oct 29, 2003 9:44 am
Location: Germany
Contact:

Post by the_bunny » Sun Dec 19, 2004 12:43 pm

addso wrote: Please post here or in PM the english adaptation for non-french people :oops:

well, i don't know what's hard to understand in that topic, FIND & AFTER,ADD are english terms if i remember right, hehe... :wink:

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/page_header.php 
# 
#-----[ FIND ]------------------------------------------ 
# 
$template->set_filenames(array( 
   'overall_header' => ( empty($gen_simple_header) ) 
); 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
ob_start(); 
function replace_mod_rewrite($s) 
{ 

   $urlin = array( 
 //Forums 
   "'(?<!/\./)index.php\?f=([0-9]*)&ppage=([0-9]*)&sort=lastpost&order=DESC&start=([0-9]*)'", 
   "'(?<!/\./)index.php\?f=([0-9]*)&ppage=([0-9]*)&sort=lastpost&order=DESC'", 
   "'(?<!/\./)index.php\?f=([0-9]*)&mark=topics'", 
   "'(?<!/\./)index.php\?mark=forums'", 
   "'(?<!/\./)index.php\?f=([0-9]*)'", 
   "'(?<!/)index.php'", 
   "'(?<!/\./)intro.php'",
//Topics 
   "'(?<!/\./)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=asc&start=([0-9]*)'", 
   "'(?<!/\./)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=asc&vote=viewresult'", 
   "'(?<!/\./)viewtopic.php\?t=([0-9]*)&watch=topic&postorder=asc'", 
   "'(?<!/\./)viewtopic.php\?t=([0-9]*)&unwatch=topic&postorder=asc'", 
   "'(?<!/\./)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'", 
   "'(?<!/\./)viewtopic.php\?t=([0-9]*)&postorder=asc&start=([0-9]*)'",
   "'(?<!/\./)viewtopic.php\?t=([0-9]*)&view=previous'", 
   "'(?<!/\./)viewtopic.php\?t=([0-9]*)&view=next'", 
   "'(?<!/\./)viewtopic.php\?p=([0-9]*)'", 
   "'(?<!/\./)viewtopic.php\?t=([0-9]*)'", 
); 

   $urlout = array( 
//Forums 
   "forum-\\1-\\2-\\3.html", 
   "forum-\\1-\\2.html", 
   "mforum-\\1.html", 
   "mforums.html", 
   "forum-\\1.html", 
   "forums.html", 
   "intro.html",
//Topics 
   "topic-\\1-\\2-\\3.html", 
   "poll-\\1-\\2.html", 
   "wtopic-\\1.html", 
   "utopic-\\1.html", 
   "topic-\\1-\\2.html", 
   "topic-\\1-\\2.html",
   "ptopic-\\1.html", 
   "ntopic-\\1.html", 
   "post-\\1.html", 
   "topic-\\1.html", 
); 

   $s = preg_replace($urlin, $urlout, $s); 

   return $s; 
}
# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/page_tail.php 
# 
#-----[ FIND ]------------------------------------------ 
# 
$db->sql_close(); 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
$contents = ob_get_contents(); 
ob_end_clean(); 
echo replace_mod_rewrite($contents); 
global $dbg_starttime; 
# 
#-----[ FIND ]------------------------------------------ 
# 
   $gzip_contents = ob_get_contents(); 
   ob_end_clean(); 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
      echo replace_for_mod_rewrite($contents); 
      global $dbg_starttime; 
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
put in .htaccess (forum-root):

Code: Select all

RewriteEngine On 
#Forums 
   RewriteRule ^forum-([0-9]*)-([0-9]*)-([0-9]*).* index.php?f=$1&ppage=$2&sort=lastpost&order=DESC&start=$3 
   RewriteRule ^forum-([0-9]*)-([0-9]*).* index.php?f=$1&ppage=$2&sort=lastpost&order=DESC 
   RewriteRule ^mforum-([0-9]*).* index.php?f=$1&mark=topics 
   RewriteRule ^mforums.* index.php?mark=forums 
   RewriteRule ^forum-([0-9]*).* index.php?f=$1 
   RewriteRule ^forums.* index.php 
   RewriteRule ^admin/forums.* admin/index.php 
#Topics 
    RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* viewtopic.php\?t=$1&postdays=$2&postorder=asc&start=$3 
    RewriteRule ^poll-([0-9]*)-([0-9]*).* viewtopic.php\?t=$1&postdays=$2&postorder=asc&vote=viewresult 
   RewriteRule ^wtopic-([0-9]*).* viewtopic.php?t=$1&watch=topic&postorder=asc 
   RewriteRule ^utopic-([0-9]*).* viewtopic.php?t=$1&unwatch=topic&postorder=asc 
   RewriteRule ^topic-([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2 
   RewriteRule ^ptopic-([0-9]*).* viewtopic.php?t=$1&view=previous 
   RewriteRule ^ntopic-([0-9]*).* viewtopic.php?t=$1&view=next 
   RewriteRule ^post-([0-9]*).* viewtopic.php?p=$1 
   RewriteRule ^topic-([0-9]*).* viewtopic.php?t=$1 
to remove sids for guests (as search-spiders are):
### SEARCH (in includes/sessions.php) ###

Code: Select all

$SID = 'sid=' . $session_id;
### REPLACE WITH ###

Code: Select all

if ( $userdata['session_user_id'] != ANONYMOUS ){ 
   $SID = 'sid=' . $session_id; 
} else { 
   $SID = ''; 
}
### SAVE/CLOSE ALL FILES ###

**edit**
fixed a bug in multi-page view (Goto Page 1,2...)
Last edited by the_bunny on Sat Dec 25, 2004 8:54 pm, edited 1 time in total.
i'm, just a little bunny! please treat me well...

User avatar
maese
Registered User
Posts: 31
Joined: Tue Dec 14, 2004 4:34 pm
Location: ./Spain/Salamanca

Post by maese » Sun Dec 19, 2004 12:47 pm

90pages * 20 replys=1800 posts :S too many posts...

the_bunny
Registered User
Posts: 194
Joined: Wed Oct 29, 2003 9:44 am
Location: Germany
Contact:

Post by the_bunny » Sun Dec 19, 2004 12:47 pm

@ Ptirhiik:
the adaptation doesn't work with jr.admin MOD because admin/index.php is also rewritten and therefor a jr.admin gets this error:

Code: Select all

Warning: jr_admin_check_file_hashes(./../admin/forums.html): failed to open stream: No such file or directory in /www/htdocs/v110777/includes/functions_jr_admin.php on line 154

Warning: jr_admin_check_file_hashes(): Failed opening './../admin/forums.html' for inclusion (include_path='.:..') in /www/htdocs/v110777/includes/functions_jr_admin.php on line 154

Warning: Invalid argument supplied for foreach() in /www/htdocs/v110777/includes/functions_jr_admin.php on line 161

Code: Select all

The requested module does not exist or you are not an authorized user.

DEBUG MODE

Line : 50
File : /www/htdocs/v110777/admin/pagestart.php
admin/index.php won't be spidered anyways because of my robots.txt, so how do i remove url_rewrite for admin/index.php? the only reference to it is in the .htaccess but if i remove it there all i get is 404, so it must be somewhere else too.

**edit**
ok, i edited this in page_header.php:
"'(?<!/\./)index.php\?f=([0-9]*)&mark=topics'",
"'(?<!/\./)index.php\?mark=forums'",
"'(?<!/\./)index.php\?f=([0-9]*)'",
"'(?<!/)index.php'",
"'(?<!/\./)intro.php'",

it works now, but the nav_link won't be rewritten now. :?
i'm, just a little bunny! please treat me well...

FinalFantasy
Registered User
Posts: 277
Joined: Mon Oct 04, 2004 4:34 am
Location: Give Me 100 million Gil and ill tell you
Contact:

Post by FinalFantasy » Sun Dec 19, 2004 3:13 pm

the_bunny i have jr. admins installed and get no error.

and i still can't install Xore's mod. is there a way you can show me where to install it please?
<!-- Sig Removed Cause Graham Didn't Like Em :( -->
RPG Guru's
Veneficium

TeknoSounds
Registered User
Posts: 17
Joined: Tue Jul 06, 2004 5:47 pm
Location: ATX
Contact:

Post by TeknoSounds » Sun Dec 19, 2004 3:47 pm

Greetings :)

I can say I really appreciate the work you put into this as well as my members. I'm not sure if this has been posted already, but I did searches for looping login and login loop and didn't find anything. Heres the situation:

I recently installed a fresh copy of phpBB 2.0.11 and using an old database. While I had a clean install I wanted to use your mods so I wouldn't have any headache with my old themes. First I tried installing PCP first, however some of the replacement statements couldn't be found, so I edited them. After getting it to install I got to the login screen, logged in and was presented with the Migration Tool page. However after clicking go all I get is another login screen. This just puts me in an (what I'm guessing is...) endless loop of login, migration page, login, etc. Going back I reinstalled a fresh copy of 2.0.11 then used the dev211 file. This gave me the same result.

What might I be doing wrong?

the_bunny
Registered User
Posts: 194
Joined: Wed Oct 29, 2003 9:44 am
Location: Germany
Contact:

Post by the_bunny » Sun Dec 19, 2004 5:38 pm

FinalFantasy wrote: the_bunny i have jr. admins installed and get no error.


did u try to login to acp with a jr.admin account? the normal admins can get in w/o probs, only juniors do get this error.
i'm, just a little bunny! please treat me well...

niprova
Registered User
Posts: 15
Joined: Sat Feb 28, 2004 9:44 am

lang italian

Post by niprova » Sun Dec 19, 2004 5:46 pm

Is there the lang italian of this mod?

NoGood
Registered User
Posts: 79
Joined: Tue Dec 23, 2003 3:29 pm

Post by NoGood » Sun Dec 19, 2004 6:07 pm

... or a Dutch version? It's too much to translate all by myself ...

Btw, the "Today at/Yesterday at" is show on the index, but not on viewtopic. Is this normal? I used the pre-modded pack.

alisk8
Registered User
Posts: 50
Joined: Tue Sep 02, 2003 6:44 am

Post by alisk8 » Sun Dec 19, 2004 8:16 pm

Ptirhiik, what function/file do I edit or remove to get rid of the icons that show for the topics you've posted in?

Thanks :)

javispedro
Registered User
Posts: 58
Joined: Thu Apr 22, 2004 7:34 pm

Post by javispedro » Mon Dec 20, 2004 10:26 pm

alisk8 wrote: Ptirhiik, what function/file do I edit or remove to get rid of the icons that show for the topics you've posted in?

As a temporary fix, you could look for the images that show "you have posted in" and replace them with the original images ;)

User avatar
Hater
Registered User
Posts: 570
Joined: Tue May 06, 2003 8:56 pm
Location: Wisconsin
Contact:

Post by Hater » Mon Dec 20, 2004 10:47 pm

That is exactly what I would recommend. ;)

NoGood
Registered User
Posts: 79
Joined: Tue Dec 23, 2003 3:29 pm

Post by NoGood » Tue Dec 21, 2004 5:22 pm

When i lock a sticky, it gets the tag [sticky] in front of the topic title (because there's no icon for a locked sticky?). Is there any (preferably non-coded) way to get rid of this?

tia

the_bunny
Registered User
Posts: 194
Joined: Wed Oct 29, 2003 9:44 am
Location: Germany
Contact:

Post by the_bunny » Tue Dec 21, 2004 6:00 pm

Ptirhiik - RPGnet-fr wrote: > Gladhost.com : mod url-rewriting : some adaptations has been done here. Sorry comments are in french, but you will probably find your way with,


Ptirhiik: there seems to be a bug in the url-rewriting as posted at gilgraf's board. when i view a topic which goes over more than one page like here:
Goto page: 1, 2 Next

i can't get to page 2, because after i click on it it always redirects me back to page 1... :?
i can't ask on ggweb-fr.com because it's all in french and i don't speak french... :(
i'm, just a little bunny! please treat me well...

Locked

Return to “[2.0.x] MODs in Development”