Page 11 of 11

Posted: Fri Jan 12, 2007 6:59 am
by Xoduz
After updating my forum to 2.0.22, the forum is suddenly treating my custom topic types as "announce/stickies" and moves them to the top of the forum whether I want them to or not :|

The mod itself seems to work fine, it's only this "move every topic with advanced type to the top of the forum" I don't like.

Any ideas?

Posted: Sun Jan 14, 2007 3:41 am
by rewardstupid
I've given up on this mod. I managed to get one of my topic types to display its icon but the other two wouldn't.

Posted: Wed Jan 17, 2007 2:45 pm
by martin_uy
KE5EHI wrote: Cusrious to see if anyone has updated this mod yet with all of the fixes?
Yes, I've got this mod working on my old forum.

Unfortunately I didn't wrote file changes so they are there but I can't tell you which they were :(

If I decide to install it on my new forum I will take care and write a newer/working version :P

Posted: Fri Jan 19, 2007 4:17 pm
by PCGUY112887
Does anyone know of a way to FORCE users to pick a topic type? By default it's blank, and I want users to HAVE to pick one before it allows them to post.

Posted: Fri Mar 02, 2007 9:20 am
by bbnewbie
noone have a working code for 2.0.22 ?

Posted: Fri Mar 02, 2007 7:51 pm
by murnauvsbuñuel
working to phpBB 2.0.22? any similar mod more lite? thanks

Re: [RC] Advanced Topic Type

Posted: Fri Aug 17, 2007 2:29 pm
by bamavamp
This mod needs to be removed as no one is providing help for it anymore. I have had this mod installed, and everything shows correctly in acp--no error messages--however when I try to pick one of my new topic types when posting a message, it posts as a normal post instead of TIPS or whatever type I had chosen.


Re: [RC] Advanced Topic Type

Posted: Mon Oct 01, 2007 7:12 am
by gfonseca
bamavamp wrote:This mod needs to be removed as no one is providing help for it anymore. I have had this mod installed, and everything shows correctly in acp--no error messages--however when I try to pick one of my new topic types when posting a message, it posts as a normal post instead of TIPS or whatever type I had chosen.

I second this. It seems we are all having the same problem with this MOD. It appears to be working fine but the topic names don't show up next to the posts.

Unless someone can figure out a way to fix this (which doesn't seem likely) it should be removed.

Re: [RC] Advanced Topic Type

Posted: Tue Oct 02, 2007 11:20 pm
by lugsciath
Okay Folks,

I´ve added the Mod to my 2.022 heavy modded board and i´ve found it useful, but dont working :-) ... After hours i got first results and now i keep em work, but with one thing only ... the last added topic would not be shown, because empty fields. I think i get this bug in the next days, but if someone catch that bug faster i´ve would be pretty happy :-)

Here are the changes (sorry for my bod english and this kind of coding, but it is the best i´m able to).


viewtopic.php

find

Code: Select all

		$replies = $topic_rowset[$i]['topic_replies'];
		$topic_type = $topic_rowset[$i]['topic_type'];
after add

Code: Select all

    // BEGIN Advanced Topic Type MOD
    //////////////////////////////////////////////////////////////////////////////////////
    // little bugfix by lugsciath - without any warranty                                //
    // the bug is very easy: only sticky and announce will be counted - that´s the bug. //
    // just do it without any borders and see: it works.                                //
    //////////////////////////////////////////////////////////////////////////////////////

    $sql = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ."";

    if ( !($result = $db->sql_query($sql)) )
    {
      message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
    }

    if( $topic_type == POST_ANNOUNCE )
    {
      $topic_type = '<span style="color:'. $announce_color .'">'. $lang['Topic_Announcement'] . ' </span>';
    }
    else if( $topic_type == POST_STICKY )
    {
      $topic_type = '<span style="color:'. $sticky_color .'">'. $lang['Topic_Sticky'] . ' </span>';
    }
    else if( $topic_type == POST_TITLE_LINK )
    {
	   $topic_type = '<span style="color:'. $weblink_color .'">'. $lang['Topic_Weblink'] . ' </span>';
    }

    else if( $topic_type > POST_GLOBAL_ANNOUNCE)
    {
     while ($tt_row = $db->sql_fetchrow($result))
     {
     $row[] = $tt_row;
     $topic_type_color = '#'.$tt_row['topic_type_color'];
     $topic_type_name = '#'.$tt_row['topic_type_name'];
     }
     ///////////////////// End Lugsciath
      for($j = 0; $j < count($row); $j++ )
      {
        if( intval($topic_rowset[$i]['topic_type'] - POST_ADD_TYPE) == $row[$j]['topic_type_order'])
        {
        $topic_type ='<span style="color:#'. $row[$j]['topic_type_color'] .'">'. $row[$j]['topic_type_name'] .':</span>';
        }
      }
    }
    // END Advanced Topic Type MOD
find

Code: Select all

else if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
			{
				$folder = $images['folder_locked'];
				$folder_new = $images['folder_locked_new'];
			}
after, add

Code: Select all

            // BEGIN Advanced Topic Type MOD
            else if( $topic_rowset[$i]['topic_type'] >= POST_ADD_TYPE)
            {
              if( $row[$i]['topic_type_image'] != '' )
                {
                $folder = $row[$i]['topic_type_image'];
                $folder_new = $row[$i]['topic_type_image_new'];
                }
              else
                {
              $folder = $images['folder_topic_type'];
	          $folder_new = $images['folder_topic_type_new'];
                }
            }
            // END Advanced Topic Type MOD
See above that only a = (equal) was added.
okay, here is part II

posting.php

find

Code: Select all

if ( $mode == 'editpost' && ( ( $is_auth['auth_delete'] && $post_data['last_post'] && ( !$post_data['has_poll'] || $post_data['edit_poll'] ) ) || $is_auth['auth_mod'] ) )
{
	$template->assign_block_vars('switch_delete_checkbox', array());
}
after add

Code: Select all

// BEGIN Advanced Topic Type MOD

//
// Topic type selection
//
$topic_type_toggle = '';
if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) )
{
  $template->assign_block_vars('switch_type_toggle', array());

   $topic_type_toggle .= '<select name="topictype">';
   $topic_type_toggle .= '<option value="'. POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' selected' : '' ) . '>'. $lang['Post_Normal'] .'</option>';


	if( ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) && $is_auth['auth_post'] )
	{
        $topic_type_toggle .= '<option value="' . POST_TITLE_LINK . '"';
		if ( $post_data['topic_type'] == POST_TITLE_LINK || $topic_type == POST_TITLE_LINK )
		{
            $topic_type_toggle .= ' selected';
		}
        $topic_type_toggle .= '>'. $lang['Post_Weblink'] . '</option>';
	}
//eingefügt von Mod , eigentlich nur radios gegen liste

  if( $is_auth['auth_sticky'] )
  {
    $topic_type_toggle .= '<option value="' . POST_STICKY . '"';
    if ( $post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY )
    {
      $topic_type_toggle .= ' selected';
    }
    $topic_type_toggle .= '>'. $lang['Post_Sticky'] . '</option>';
  }

  if( $is_auth['auth_announce'] )
  {
    $topic_type_toggle .= '<option value="' . POST_ANNOUNCE . '"';
    if ( $post_data['topic_type'] == POST_ANNOUNCE || $topic_type == POST_ANNOUNCE )
    {
      $topic_type_toggle .= ' selected';
    }
    $topic_type_toggle .= '>'. $lang['Post_Announcement'] . '</option>';
  }
Please remember: I got a really lot of mods, you have to search for the right place - and maybe it doesnt work.

One Thing: The Announcement and sticky´s are untouched, the mod doesnt work very well - but it is really nice and i hope and think, it will be modded further.

Re: [RC] Advanced Topic Type

Posted: Wed Oct 03, 2007 10:47 am
by lugsciath
okay Folks,

Time for a update. Now i got a little problem with the images, but it is solved. All Changes are well if you take my modifikation , otherwise you have to change the similiar passages ;-)

Step 1: Please save your original files! I dont know your system and i dont make any warranty for function of these hacks on your system ! My board is a phpBB2 subSilver 2.022 with a lot of mods, so it will be some different to yours (but never mind: try it or change it in a similiar way if you have a backup!).

open viewforum.php

find:

Code: Select all

        $topic_type ='<span style="color:#'. $row[$j]['topic_type_color'] .'">'. $row[$j]['topic_type_name'] .':</span>';
add after

Code: Select all

              if( $row[$j]['topic_type_image'] != '' )
                {
                $folder = $row[$j]['topic_type_image'];
                $folder_new = $row[$j]['topic_type_image_new'];
                }
              else
                {
              $folder = $images['folder_topic_type'];
	          $folder_new = $images['folder_topic_type_new'];
                }
(i put this part in the part above, the var $row[$i] doesnt work, so i take the var [$j] above ... ;-) )

find

Code: Select all

// BEGIN Advanced Topic Type MOD
            else if( $topic_rowset[$i]['topic_type'] >= POST_ADD_TYPE)
            {
              if( $row[$i]['topic_type_image'] != '' )
                {
                $folder = $row[$i]['topic_type_image'];
                $folder_new = $row[$i]['topic_type_image_new'];
                }
              else
                {
              $folder = $images['folder_topic_type'];
             $folder_new = $images['folder_topic_type_new'];
                }
replace it with:

nothing.

find (beneath this part directly)

Code: Select all

			else if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
			{
				$folder = $images['folder_locked'];
				$folder_new = $images['folder_locked_new'];
			}
else
find in line

Code: Select all

else
replace it with

Code: Select all

			else if( $topic_rowset[$i]['topic_type'] < POST_ADD_TYPE )

open admin/admin_topic_type.php

find

Code: Select all

 if( $row['topic_type_image'] != '' )
  {
    $tt_image = $phpbb_root_path . $row['topic_type_image'] ;
  }
[code]

replace it with

[code]
  if( $row['topic_type_image'] != '' )
  {
    $tt_image = $row['topic_type_image'] ;
  }
Thats all.

All you have to do now is to put in the real full path (with url) to your topic image into the admin panel

e.g.

WRONG: /templates/subSilver/phpBB/images/whateveryouwant.gif
RIGHT: http://www.yourdomainrighthere.com/phpB ... ouwant.gif

;-)

Have fun. The other bug with the last topic isn´t really solved, but personally i´ve solved tomporarely in this way:

Make a Topic with title "END OF LIST - DO NOT ENTER THIS!" and sign it in the Admin panel as "Top". Than you only have to change the sorting that this topic is last (on bottom of the list) with use for all (importend!)
. So it wont be really available and your users have to choose something above it. See: All functions are keep going ;-) ... but if i found this little bug, i will report it as soon as possible.

More Questions? Please feel free to mail me (as content: phpBB2, my spamprotection is sometimes strong).

Greetings

Uwe

Edit: Sorry, i forgot the upper part of code, i add it :-) for function

Re: [RC] Advanced Topic Type

Posted: Wed Oct 03, 2007 5:02 pm
by lugsciath
hi Folks,

update #2

in viewtopic.php

a little correction for weblink mod

find:

Code: Select all

// BEGIN Advanced Topic Type MOD
    //////////////////////////////////////////////////////////////////////////////////////
    // little bugfix by lugsciath - without any warranty                                //
    // the bug is very easy: only sticky and announce will be counted - that´s the bug. //
    // just do it without any borders and see: it works.                                //
    //////////////////////////////////////////////////////////////////////////////////////

    $sql = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ."";

    if ( !($result = $db->sql_query($sql)) )
    {
      message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
    }

    if( $topic_type == POST_ANNOUNCE )
    {
      $topic_type = '<span style="color:'. $announce_color .'">'. $lang['Topic_Announcement'] . ' </span>';
    }
    else if( $topic_type == POST_STICKY )
    {
      $topic_type = '<span style="color:'. $sticky_color .'">'. $lang['Topic_Sticky'] . ' </span>';
    }
    else if( $topic_type == POST_TITLE_LINK )
    {
      $topic_type = '<span style="color:'. $weblink_color .'">'. $lang['Topic_Weblink'] . ' </span>';
    }

    else if( $topic_type > POST_GLOBAL_ANNOUNCE)
    {
     while ($tt_row = $db->sql_fetchrow($result))
     {
     $row[] = $tt_row;
     $topic_type_color = '#'.$tt_row['topic_type_color'];
     $topic_type_name = '#'.$tt_row['topic_type_name'];
     }
     ///////////////////// End Lugsciath
      for($j = 0; $j < count($row); $j++ )
      {
        if( intval($topic_rowset[$i]['topic_type'] - POST_ADD_TYPE) == $row[$j]['topic_type_order'])
        {
        $topic_type ='<span style="color:#'. $row[$j]['topic_type_color'] .'">'. $row[$j]['topic_type_name'] .':</span>';
        }
      }
    }
    // END Advanced Topic Type MOD



replace it through

Code: Select all

    if( $topic_type == POST_ANNOUNCE )
    {
      $topic_type = '<span style="color:'. $announce_color .'">'. $lang['Topic_Announcement'] . ' </span>';
    }
    else if( $topic_type == POST_STICKY )
    {
      $topic_type = '<span style="color:'. $sticky_color .'">'. $lang['Topic_Sticky'] . ' </span>';
    }
    else if( $topic_type == POST_TITLE_LINK )
    {
	   $topic_type = '<span style="color:'. $weblink_color .'">'. $lang['Topic_Weblink'] . ' </span>';
    }

    // BEGIN Advanced Topic Type MOD
    //////////////////////////////////////////////////////////////////////////////////////
    // little bugfix by lugsciath - without any warranty                                //
    // the bug is very easy: only sticky and announce will be counted - that´s the bug. //
    // just do it without any borders and see: it works.                                //
    //////////////////////////////////////////////////////////////////////////////////////
//    $sql = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ." WHERE `topic_type_id` > '0';";
    $sql = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ."";
    if ( !($result = $db->sql_query($sql)) )
    {
      message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
    }

//    else if( $topic_type > POST_GLOBAL_ANNOUNCE)
    else if( $topic_type > POST_TITLE_LINK)
    {
     while ($tt_row = $db->sql_fetchrow($result))
     {
     $row[] = $tt_row;
     $topic_type_color = '#'.$tt_row['topic_type_color'];
     $topic_type_name = '#'.$tt_row['topic_type_name'];
     }
     ///////////////////// End Lugsciath
      for($j = 0; $j < count($row); $j++ )
      {
        if( intval($topic_rowset[$i]['topic_type'] - POST_ADD_TYPE) == $row[$j]['topic_type_order'])
        {
        $topic_type ='<span style="color:#'. $row[$j]['topic_type_color'] .'">'. $row[$j]['topic_type_name'] .':</span>';
/*            // BEGIN Advanced Topic Type MOD
            else if( $topic_rowset[$i]['topic_type'] >= POST_ADD_TYPE)
            {
              if( $row[$i]['topic_type_image'] != '' )
                {
                $folder = $row[$i]['topic_type_image'];
                $folder_new = $row[$i]['topic_type_image_new'];
                }
              else
                {
              $folder = $images['folder_topic_type'];
	          $folder_new = $images['folder_topic_type_new'];
                }
            }
            // END Advanced Topic Type MOD
*/
              if( $row[$j]['topic_type_image'] != '' )
                {
                $folder = $row[$j]['topic_type_image'];
                $folder_new = $row[$j]['topic_type_image_new'];
                }
              else
                {
              $folder = $images['folder_topic_type'];
	          $folder_new = $images['folder_topic_type_new'];
                }
        }
      }
    }
    // END Advanced Topic Type MOD

find

Code: Select all

  	else
	{
		$topic_type = '';
	}
Replace with nothing. This is importend for Weblink mod.

If you have the weblink

in constants.php

find

Code: Select all

define('POST_TITLE_LINK', 99);
replace with

Code: Select all

define('POST_TITLE_LINK', 4);
You have to set the given topic_types for weblinks in your sql database Topics_table from set 99 set it to 4 and change all topics with 99 (or less upt to 95) in topics_table to topic_type 4.

In postings.php

find

Code: Select all

$all_topic_types = array(POST_NORMAL, POST_STICKY, POST_ANNOUNCE);
replace it with

Code: Select all

$all_topic_types = array(POST_NORMAL, POST_STICKY, POST_ANNOUNCE, POST_TITLE_LINK, POST_GLOBAL_ANNOUNCE);
[code]

Re: [RC] Advanced Topic Type

Posted: Thu Oct 04, 2007 7:52 pm
by lugsciath
Hi Folks,

update #4

just fixes a bug that made a leading "0" for topics, belonging on a empty topic_type with this number (simple Topics got the type 0):

viewtopic.php

find

Code: Select all

		$replies = $topic_rowset[$i]['topic_replies'];
		$topic_type = $topic_rowset[$i]['topic_type'];
add, after

if( $topic_type == '0')$topic_type = '';
above should be single quotes at end of the line with no space between - shown in that way: ' '

Thats it - all works fine for me - and i hope, for you too, now i have more than a handful of new topics in different colors ;-) ... and all seams fine, greetings to poupone: You did a great job, i think the bug where only structure change newer modifications and some kind of not participiating softwareroutines. So Folks: Please try and do someting programming at your self... now it should work in similiar systems.

Feel free to ask me in english - or in german as a second possibility. The mod is working well.

Fragt mich in englisch oder in deutsch als zweite Möglichkeit ;-). Das Tool funktioniert.

Re: [RC] Advanced Topic Type

Posted: Sat Dec 08, 2007 5:49 am
by bamavamp
Well I thought it was gonna work until I got this error

Parse error: syntax error, unexpected $end in /home/andreapk/public_html/posting.php on line 1160

Apparently something in the posting.php isn't working with my setup.

Something you need to fix in your above notes...everywhere you have to edit viewtopic it should be viewforum no?

I guess I will wait til a full updated version comes out or until someone else publishes one, thanks for trying.

Re: [RC] Advanced Topic Type

Posted: Sun Dec 09, 2007 4:51 pm
by lugsciath
Hi bamavamp,

you´ve right: "$replies = $topic_rowset[$i]['topic_replies']" and so on is to edit in VIEWFORUM.PHP, my fault - i´m sorry.

This error:

unexpected $end in /home/andreapk/public_html/posting.php on line 1160

expired sometimes, if you uploading a file at the same time you log into the board/work into the board. This file may just "halfready" loaded until this Position ;) ... it´s NOT a failure, it´s a natural "undone" thing. ;)

Otherwise you could eventually forget a closing semicolon, or slash oder something else on the end of a row - or the position may different (a loop?), through modding. Just send me via pm the source :) ... i take a look on it and try to search the matching position for you, ok? :)