Clan Adverts

Sponsors

CT on Facebook

Latest Product

User Box

Anonymous
38.107.179.217
Nickname:

Password:

Security Code
Security Code
Type Security Code


PND Downloads Feed

Phpnuke Downloads
How to Delete or Reset yo...
How to Delete or Reset your PHPNuke Admin Account
Lost your admin password ?  Cant login to your admin account ? This s...
Back Online & Stuff
Back Online & Stuff
Look at us with our nifty website back up and running… Seriously...
How to edit the admins in...
How to edit the admins in the forums
Here is a way to make someone admin in your forums on your Evo site. I...
Demo Splash Screen
Demo Splash Screen
Ped @ Clan Themes has released a simple splash screen entrance hack. ...
Free Phpnuke Business The...
Free Phpnuke Business Theme 6
This is the 6th Business theme for Phpnuke that Clan Themes has releas...
Tricked Out Slider
Tricked Out Slider
We have seen some great new things come out of Tricked Out News and th...

Custom Work

PHP Nuke Custom Work

www.clanthemes.com :: View topic - Split topic hack
Split topic hack

2 Replies / 1662 Views


Post new topic   Reply to topic  

   www.clanthemes.com Forum Index » PHPBB

View previous topic :: View next topic


Meph
Reputation: 456.5 Add RepSubtract Rep
Local time: 5:15 PM
Location: Chicago
usa.gif

Spammer
Spammer

0.05 posts per day
Medals: 0

Joined: Jul 17, 2007
Last Visit: 22 Aug 2011
Posts: 81
Points: 3324 

Post Split topic hack Posted: Thu Feb 14, 2008 5:01 am

Hey for some reason the mod is showing two bars for stickys/announcements. What code would be causing this so I could just remove it and not use it all together


Code:
modules/Forums/viewforum.php
#
#-----[ FIND ]------------------------------------------
#
//
// Okay, lets dump out the page ...
//
if( $total_topics )
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : split topic type ------------------------------------------------------------------------
//-- add v 1.0.3
   $prec_topic_real_type = -1;
//-- fin mod : split topic type --------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
         'U_VIEW_TOPIC' => $view_topic_url)
      );
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : split topic type ------------------------------------------------------------------------
//-- add
      $topic_real_type = $topic_rowset[$i]['topic_type'];
//-- add v 1.0.3
      //
      // si on ne veut pas de ruptures, on groupe tous les posts au niveau sujets normaux
      if (!$switch_split_announce) $topic_real_type = POST_NORMAL;
      //
      // si on ne veut pas de rupture au niveau global announcement, les grouper avec les posts normaux
      if ( (!$switch_split_global_announce) && ($topic_real_type == POST_GLOBAL_ANNOUNCE) ) $topic_real_type = POST_ANNOUNCE;
//--
      //
      // si on ne veut pas de rupture au niveau sticky, les grouper avec les posts normaux
      if ( (!$switch_split_sticky) && ($topic_real_type == POST_STICKY) ) $topic_real_type = POST_NORMAL;
//-- add v 1.0.3
      //
      // gérer la rupture précédente
      $is_rupt = false;
      if ($prec_topic_real_type != $topic_real_type)
      {
         // 1ère rupture : ne prendre en compte que s'il s'agit d'un post de type autre que normal
         if ($prec_topic_real_type == -1) $is_rupt = ( $topic_real_type != POST_NORMAL );

         // autre rupture : prendre en compte
         if ($prec_topic_real_type != -1) $is_rupt = true;
      }
      //
      // envoyer les ruptures à l'écran
//-- add v 1.0.3
      if ( $is_rupt )
      {
         $title = '';
         switch ($topic_real_type)
         {
            case POST_GLOBAL_ANNOUNCE: // (dans les constantes mais non utilisé)
//-- add v 1.0.3
               $title = $lang['Post_global_announcement']."s";
               break;
//--
            case POST_ANNOUNCE:
               $title = $lang['Post_Announcement']."s";
               break;

            case POST_STICKY: // on prépare une éventuelle rupture
               $title = $lang['Post_Sticky'];
               break;

            case POST_NORMAL:
               $title = $lang['Topics'];
               break;

            default:
               $title = '???';
               break;
         }

         $template->assign_block_vars('topicrow.topictype', array(
            'TITLE' => $title,
            )
         );
      }
      $prec_topic_real_type = $topic_real_type;
//-- fin mod : split topic type --------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
$template->pparse('overall_header');
#
#-----[ BEFORE, ADD ]-----------------------------------
#
//-- mod : split topic type ------------------------------------------------------------------------
//-- add v 1.0.2
// split ?
$switch_split_announce = true;
if ( !isset( $board_config['split_announce'] ) )
{
   $sqlw = "insert into ".CONFIG_TABLE." (config_name,config_value) VALUES('split_announce','" . $switch_split_announce . "')";
   if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_annonce in config table', '', __LINE__, __FILE__, $sql);
   $board_config['split_announce'] = $switch_split_announce;
}
if ( isset( $board_config['split_announce'] ) )
{
   $switch_split_announce = $board_config['split_announce'];
}

//-- add v 1.0.3
// split global announce
$switch_split_global_announce = isset($lang['Post_global_announcement']);
if ( isset($lang['Post_global_announcement']) && !isset( $board_config['split_global_announce'] ) )
{
   $sqlw = "insert into ".CONFIG_TABLE." (config_name,config_value) VALUES('split_global_announce','" . $switch_split_global_announce . "')";
   if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_annonce in config table', '', __LINE__, __FILE__, $sql);
   $board_config['split_global_announce'] = $switch_split_global_announce;
}
if ( isset($lang['Post_global_announcement']) && isset( $board_config['split_global_announce'] ) )
{
   $switch_split_global_announce = $board_config['split_global_announce'];
}
//--

// split sticky
$switch_split_sticky = true;
if ( !isset( $board_config['split_sticky'] ) )
{
   $sqlw = "insert into ".CONFIG_TABLE." (config_name,config_value) VALUES('split_sticky','" . $switch_split_sticky . "')";
   if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_sticky in config table', '', __LINE__, __FILE__, $sql);
   $board_config['split_sticky'] = $switch_split_sticky;
}
if ( isset( $board_config['split_sticky'] ) )
{
   $switch_split_sticky = $board_config['split_sticky'];
}
//-- fin mod : split topic type --------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------
#
# note : no change between v 1.0.2 and v 1.0.3
#
themes/YOUR_THEME/forums/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------
#
   <!-- BEGIN topicrow -->
#
#-----[ AFTER, ADD ]------------------------------------------
# Note : take care to increment the colspan at your needs, ie if you've installed the Msg Icon mod
#
<!-- mod : split topic type -->
   <!-- BEGIN topictype -->
   <tr>
     <td colspan="6" align="left" class="catLeft"><span class="cattitle">{topicrow.topictype.TITLE}</span></td>
   </tr>
   <!-- END topictype -->
<!-- fin mod : split topic type -->
#
#-----[ OPEN ]------------------------------------------
#
modules/Forums/admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
$template->set_filenames(array(
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//-- mod : split topic type ------------------------------------------------------------------------
//-- add
$split_announce_yes = ( $new['split_announce'] ) ? "checked=\"checked\"" : "";
$split_announce_no  = (!$new['split_announce'] ) ? "checked=\"checked\"" : "";
$split_sticky_yes   = ( $new['split_sticky'] )   ? "checked=\"checked\"" : "";
$split_sticky_no    = (!$new['split_sticky'] )   ? "checked=\"checked\"" : "";
//-- add v 1.0.3
if ( isset($lang['Post_global_announcement']) )
{
   $split_global_announce_yes = ( $new['split_global_announce'] ) ? "checked=\"checked\"" : "";
   $split_global_announce_no  = (!$new['split_global_announce'] ) ? "checked=\"checked\"" : "";
}
//-- fin mod : split topic type --------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
$template->assign_vars(array(
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : split topic type ------------------------------------------------------------------------
//-- add
   "L_ANNOUNCEMENT_SETTINGS" => $lang['Announce_settings'],
   "L_SPLIT_ANNOUNCE"        => $lang['split_announce'],
   "SPLIT_ANNOUNCE_YES"      => $split_announce_yes,
   "SPLIT_ANNOUNCE_NO"       => $split_announce_no,
   "L_SPLIT_STICKY"          => $lang['split_sticky'],
   "SPLIT_STICKY_YES"        => $split_sticky_yes,
   "SPLIT_STICKY_NO"         => $split_sticky_no,
//-- add v 1.0.3
   "L_SPLIT_GLOBAL_ANNOUNCE" => $lang['split_global_announce'],
   "SPLIT_GLOBAL_ANNOUNCE_YES" => $split_global_announce_yes,
   "SPLIT_GLOBAL_ANNOUNCE_NO" => $split_global_announce_no,
//-- fin mod : split topic type --------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
$template->pparse("body");
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//-- mod : split topic type ------------------------------------------------------------------------
//-- add v 1.0.3
if ( isset($lang['Post_global_announcement']) ) $template->assign_block_vars('switch_global_announce', array());
//-- fin mod : split topic type --------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------
#
modules/Forums/templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
   <tr>
     <th class="thHead" colspan="2">{L_ABILITIES_SETTINGS}</th>
   </tr>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- mod : split topic type -->
   <tr>
      <th class="thHead" colspan="2">{L_ANNOUNCEMENT_SETTINGS}</th>
   </tr>
   <tr>
      <td class="row1">{L_SPLIT_ANNOUNCE}</td>
      <td class="row2"><input type="radio" name="split_announce" value="1" {SPLIT_ANNOUNCE_YES} /> {L_YES}  <input type="radio" name="split_announce" value="0" {SPLIT_ANNOUNCE_NO} /> {L_NO}</td>
   </tr>
<!-- add v 1.0.3 -->
   <!-- BEGIN switch_global_announce -->
   <tr>
      <td class="row1">{L_SPLIT_GLOBAL_ANNOUNCE}</td>
      <td class="row2"><input type="radio" name="split_global_announce" value="1" {SPLIT_GLOBAL_ANNOUNCE_YES} /> {L_YES}  <input type="radio" name="split_global_announce" value="0" {SPLIT_GLOBAL_ANNOUNCE_NO} /> {L_NO}</td>
   </tr>
   <!-- END switch_global_announce -->
<!-- -->
   <tr>
      <td class="row1">{L_SPLIT_STICKY}</td>
      <td class="row2"><input type="radio" name="split_sticky" value="1" {SPLIT_STICKY_YES} /> {L_YES}  <input type="radio" name="split_sticky" value="0" {SPLIT_STICKY_NO} /> {L_NO}</td>
   </tr>
<!-- fin mod : split topic type -->
# -------------
# Author note : if you have the mod : "Announces from forums on index" installed, move here the lines
# -------------
# <!-- mod : annonces -->
#    <tr>
#      <td class="row1">{L_ANNOUNCEMENT_DURATION}</td>
#      <td class="row2"><input type="text" name="announcement_duration" size="4" maxlength="4" value="{ANNOUNCEMENT_DURATION}" /></td>
#    </tr>
# <!-- fin mod : annonces -->

#
#-----[ OPEN ]------------------------------------------
#
modules/Forums/language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//-- mod : split topic type ------------------------------------------------------------------------
//-- add
$lang['Announce_settings'] = 'Announcements Settings';
$lang['split_announce'] = 'Split announcement from other topic types';
$lang['split_sticky'] = 'Split sticky topics too';
//-- add v 1.0.3
$lang['split_global_announce'] = 'Split also global announcement';
//-- fin mod : split topic type --------------------------------------------------------------------
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
 

 
View user's profileSend private messageMSN Messenger Reply with quote

floppy
Reputation: 2088.8 Add RepSubtract Rep
votes: 22
Local time: 6:15 PM
Location: Jackson Mississippi
usa.gif

Site Admin
Site Admin

1.17 posts per day
Medals: 2 (View more...)
Super Dedicated User (Amount: 1)
Scripts/Coder
Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 03 May 2012
Posts: 2353
Points: 132516 

Post Split topic hack Posted: Thu Feb 14, 2008 3:08 pm

Shop Purchases:
Clan Roster 2.0 · Multi Gaming (Warrior) Evo Theme · COD6 ModernWarfare 2 Teaser Splash Screen · Left for Dead Evo Extreme Version

Code:
#-----[ OPEN ]------------------------------------------
#
# note : no change between v 1.0.2 and v 1.0.3
#
themes/YOUR_THEME/forums/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------
#
   <!-- BEGIN topicrow -->
#
#-----[ AFTER, ADD ]------------------------------------------
# Note : take care to increment the colspan at your needs, ie if you've installed the Msg Icon mod
#
<!-- mod : split topic type -->
   <!-- BEGIN topictype -->
   <tr>
     <td colspan="6" align="left" class="catLeft"><span class="cattitle">{topicrow.topictype.TITLE}</span></td>
   </tr>
   <!-- END topictype -->
<!-- fin mod : split topic type -->


Gonna be the code above, but not 100% sure. I would need to see a live example or screenshot.
 

Phpnuke Downloads | VMaxxRx Male Enhancement  
View user's profileSend private messageVisit poster's website Reply with quote

Meph
Reputation: 456.5 Add RepSubtract Rep
Local time: 5:15 PM
Location: Chicago
usa.gif

Spammer
Spammer

0.05 posts per day
Medals: 0

Joined: Jul 17, 2007
Last Visit: 22 Aug 2011
Posts: 81
Points: 3324 

Post Split topic hack Posted: Thu Feb 14, 2008 7:01 pm

Yea, I took a chance and uploaded the backup and it works fine now thanks..

For future reference for members that edit isnt needed what so ever.
 

 
View user's profileSend private messageMSN Messenger Reply with quote

Post new topic   Reply to topic  
   www.clanthemes.com Forum Index » PHPBB


 
2 Replies / 1662 Views
Page 1 of 1
All times are GMT
Display posts from previous:   
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum