[RC] Advanced Topic Type

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.
Post Reply
n00bstorm
Registered User
Posts: 481
Joined: Sun Jan 30, 2005 7:52 pm

Post by n00bstorm »

:cry: :cry: :cry:

DKing
Registered User
Posts: 751
Joined: Sat Jul 03, 2004 8:38 pm

Post by DKing »

I installed it on a vanilla (un-modded) phpBB 2.0.13, and I get the following when I go to my admin/index.php:
// BEGIN Advanced Topic Type MOD $lang['admin_topic_type'] = 'Topic Type Admin'; $lang['Topic_type_gestion'] = 'Topic types management'; $lang['Topic_type_gestion_explain'] = 'This feature allows you to add topic types.'; $lang['Topic_type_name'] = 'Topic type name'; $lang['Color'] = 'Topic type color'; $lang['Topic_type_order'] = 'Topic types order'; $lang['already_first'] = 'Topic type is already first'; $lang['already_last'] = 'Topic type is already last'; $lang['Click_return_admintopictype'] = 'Click %shere%s to go to topic type management'; $lang['tt_updated'] = 'Topic type has been successfully updated'; $lang['tt_added'] = 'Topic type has been successfully added'; $lang['tt_Deleted'] = 'Topic type has been successfuly deleted'; $lang['Add_topic_type'] = 'Add topic type'; $lang['topic_type_active'] = 'Put on top'; $lang['active_explain'] = 'You can choose if you want to put on top the posts with this topic type in viewforum. If you choose not, topic type will be considered as a normal post.'; $lang['topic_type_folder'] = 'Topic type image ( phpBB path )'; $lang['folder_explain'] = 'If no image is associated, a default icon will be shown'; $lang['edit_topic_type'] = 'Edit topic type'; $lang['edit_topic_type_explain'] = 'You can here modify the informations of the topic types'; $lang['Not_active'] = 'Not put on top'; $lang['Actual_color'] = 'Actual color: '; $lang['Change_color'] = 'Changer color'; $lang['tt_Announce'] = 'Announce'; $lang['topic_type_folder_new'] = 'Topic type image for a new post'; $lang['folder_new_explain'] = 'This icon will be shown when a new message is posted'; // END Advanced Topic Type MOD
Warning: Cannot modify header information - headers already sent by (output started at /home/yaggles/public_html/dking/language/lang_english/lang_admin.php:751) in /home/yaggles/public_html/dking/admin/index.php on line 647

Warning: Cannot modify header information - headers already sent by (output started at /home/yaggles/public_html/dking/language/lang_english/lang_admin.php:751) in /home/yaggles/public_html/dking/admin/index.php on line 648
-DKing
Latest phpBB Version: 2.0.21
Search For a MOD: MOD Search

n00bstorm
Registered User
Posts: 481
Joined: Sun Jan 30, 2005 7:52 pm

Post by n00bstorm »

-ttt-

Hello i installed this mod a weak ago and i have a problem which is this:

problem is this only mod can post as those types w no error when i log in under nomal user and i wanna use those types evreytime i click " Submit " i get this error

Code: Select all

Code:
Error in posting

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near ' 0)' at line 1

INSERT INTO topics (topic_title,topic_desc, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('TTT','TTT', 3, 1111940652, 1, 0, , 0)

Line : 290
File : /var/www/html/online/includes/functions_post.php
I know it has somethin to do w the tipics in phpmyadmin and i look at it but i cant figure out what i need to change for it to work? Can someone please please help me! Thx

User avatar
Kellanved
Former Team Member
Posts: 2635
Joined: Wed Jan 26, 2005 2:48 pm
Location: Meta-level

Post by Kellanved »

I have told you before: the error is not in the quoted SQL statement. The statement is incorrect due to an error located elsewhere in the code.


OK, I have to correct myself. Just ignore my above comment.

User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Post by stickerboy »

DKing, your error is because of an error in the install file.
It asks to add the lan_admin.php edits AFTER

Code: Select all

?>
when if fact it should be BEFORE ;)

n00bstorm > i'm currently looking over this problem. I know this MOD works, it must be incompatible somehow with the later versions oh phpBB :oops:

*edit* n00bstorm, you haven't run the sql queries.
you will have to run the db_update.php file before this MOD will work.
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red

n00bstorm
Registered User
Posts: 481
Joined: Sun Jan 30, 2005 7:52 pm

Post by n00bstorm »

i did run the db_update.php file right after i install the mod?!? and it works perfectly on my admin account but when i swich to normal user and i get this error... no idea what it can be?

DKing
Registered User
Posts: 751
Joined: Sat Jul 03, 2004 8:38 pm

Post by DKing »

cherokee red wrote: DKing, your error is because of an error in the install file.
It asks to add the lan_admin.php edits AFTER

Code: Select all

?>
when if fact it should be BEFORE ;)


It works now! Thanks

-DKing
-DKing
Latest phpBB Version: 2.0.21
Search For a MOD: MOD Search

n00bstorm
Registered User
Posts: 481
Joined: Sun Jan 30, 2005 7:52 pm

Post by n00bstorm »

Dking can u do me real fast favor? Make a new topic type and make it so REG people can use it and try it as a REG user to post w it and tell me if it works? =)

Chimaeros
Registered User
Posts: 1
Joined: Fri Apr 01, 2005 11:47 pm

Post by Chimaeros »

Poupoune wrote: Try this :
#
#-----[ OPEN ]----------------------------------------------
#

viewforum.php

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

$sql = "SELECT t.*, t1.topic_type_color AS announce_color,

#
#-----[ IN-LINE FIND ]----------------------------------------------
#

t2.topic_type_color AS sticky_color

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------------------
#

, th.template_name AS template_name

#
#-----[ IN-LINE FIND ]----------------------------------------------
#

, ". TOPIC_ADD_TYPE_TABLE ." t2

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------------------
#

, ". THEMES_TABLE ." th

#
#-----[ IN-LINE FIND ]----------------------------------------------
#

AND t2.topic_type_name = 'sticky'";

#
#-----[ IN-LINE REPLACE WITH ]----------------------------------------------
#

AND t2.topic_type_name = 'sticky'
AND th.themes_id = ". ( ( $board_config['override_user_style'] ) ? $board_config['default_style'] : $userdata['user_style'] ) ;

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

$row[] = $tt_row;

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

$template_name = $tt_row['template_name'];


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

$folder = $row[$j]['topic_type_image'];
$folder_new = $row[$j]['topic_type_image_new'];

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

$folder = 'templates/'.$template_name.'/images/'.$row[$i]['topic_type_image'];
$folder_new = $row['template_name'].'images'.$row[$i]['topic_type_image_new'];


Then with this in the ACP you will have to enter only the name of the file.
Ex: icon.gif and not templates/XXX/images/test.gif
The image will have to be in the images/ folder of each template installed on the forum.


Strange...I did this and it worked the first time, but as soon as I deleted a post from the forum (a normal post that was above the new topic type one), the folder image became the "red x" and no matter what I do in the admin panel, I just can't get it to show an image anymore. I've even deleted the new topic types and remade them...no luck.

The mod works fine for me if I don't use this alteration for multiple templates.

Zoellner
Registered User
Posts: 4
Joined: Tue May 03, 2005 8:50 am

Post by Zoellner »

n00bstorm wrote: problem is this only mod can post as those types w no error when i log in under nomal user and i wanna use those types evreytime i click " Submit " i get this error


I got the same problem and located wich command causes this error.
It's in posting.php:

Code: Select all

			if ( $error_msg == '' )
			{
				$topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;

				submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length, $news_category);
			}
			break;
At normal users the line "$topic_type=..." assigns an empty value to this variable, wich causes the error in function submit_post.

How must this expression look like to work correctly?

Greets
Marc

Viking163
Registered User
Posts: 2
Joined: Fri May 13, 2005 5:27 pm

Post by Viking163 »

n00bstorm wrote: -ttt-

Hello i installed this mod a weak ago and i have a problem which is this:

problem is this only mod can post as those types w no error when i log in under nomal user and i wanna use those types evreytime i click " Submit " i get this error

Code: Select all

Code:
Error in posting

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near ' 0)' at line 1

INSERT INTO topics (topic_title,topic_desc, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('TTT','TTT', 3, 1111940652, 1, 0, , 0)

Line : 290
File : /var/www/html/online/includes/functions_post.php
I know it has somethin to do w the tipics in phpmyadmin and i look at it but i cant figure out what i need to change for it to work? Can someone please please help me! Thx


I have the exact same problem :( as admin everything works, but a regular user can't use the mod

anyone found a solution yet ?

Zoellner
Registered User
Posts: 4
Joined: Tue May 03, 2005 8:50 am

Post by Zoellner »

anyone found a solution yet ?


Try this:

Code: Select all

# 
#-----[ OPEN ]---------------------------------------------- 
# 

posting.php

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

				$topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;

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

				// BEGIN Advanced Topic Type MOD
				$sql_tt = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ." 
				  WHERE topic_type_order = ". intval($topic_type-POST_ADD_TYPE) ;    
				
				if ( !$result_tt = $db->sql_query($sql_tt) )
				{
				  message_die(GENERAL_ERROR, 'Could not get topic type info', '', __LINE__, __FILE__, $sql_tt);
				}
				 
				while( $tt_row = $db->sql_fetchrow($result_tt) )
				{
				  $topic_auth = $tt_row['topic_type_auth']; //look up authority for current topic type
				} 
				// END Advanced Topic Type MOD
				$topic_type = ( $topic_type != $post_data['topic_type'] && ( $userdata['user_level'] < $topic_auth) && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;
I don't know if this is the correct solution, but I know it works... ;-)

If there's a better way, please let us know

Greetings
Marc

Viking163
Registered User
Posts: 2
Joined: Fri May 13, 2005 5:27 pm

Post by Viking163 »

I don't know if this is the correct solution, but I know it works...

If there's a better way, please let us know

Greetings
Marc


it works !

thanks a lot, my forum improved a lot now :D

Cybertims
Registered User
Posts: 69
Joined: Sat Dec 04, 2004 6:30 pm
Location: London UK
Contact:

Post by Cybertims »

Great MOD, all seems fine EXCEPT :-) Now when I create a Sticky, it is always at the bottom of the list on the page. Any idea what I've done or is this a bug?

Anyone else get this problem?

Cybertims
Registered User
Posts: 69
Joined: Sat Dec 04, 2004 6:30 pm
Location: London UK
Contact:

Post by Cybertims »

....bump.....

Post Reply

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