Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.0
Author Message
Virgin_Steel
Worker
Worker



Joined: Sep 30, 2004
Posts: 108
Location: Sf

PostPosted: Sun Feb 13, 2005 5:52 pm Reply with quote

Ok i wanted in my forums to be shown the penalted users with warning for ban in four level images!I hope you'll understand it, even of my terrible english...
So i just installed the "second rank" hack, but it is not adapted for php-nuke so it doesn't work! There is empty space viewtopic,profile,memberlist...So there's place for this second rank...but in phpbbAdmin pannel(admin users) it doesn't show the options for the second rank!I don't see anything wrong in the code.
Code:
   <tr>

      <td class="row1"><span class="gen">{L_SELECT_RANK2}</span></td>
      <td class="row2"><select name="user_rank2">{RANK2_SELECT_BOX}</select></td>
   </tr>
is here and i dont see the reason for not showin` rank2_select_box Sad
So here is the code i changed to adapt it for my nuke(Nuke 7.0 phpbb 2.0.6.).

Code:
ALTER TABLE phpbb_users ADD user_rank2 INT(11) AFTER user_rank; 

UPDATE phpbb_users SET user_rank2 = "0";

Code:
ALTER TABLE nuke_users ADD user_rank2 INT(11) AFTER user_rank; 

UPDATE nuke_users SET user_rank2 = "0";


Code:
##############################################################

## MOD Title: New Rank In View Topic And Member List
## MOD Author: Mighty Gorgon < mightygorgon@supereva.it > http://www.mightygorgon.cjb.net
## MOD Description: This mod add a new user rank , the new rank will be showed in each topic and in the memberlist.
## MOD Version: 1.01
## Installation Level: Easy
## Installation Time: 10 minutes
## Files to Edit: viewtopic.php,
##                template/subSilver/viewtopic_body.tpl,
##                memberlist.php,
##                template/subSilver/memberlist_body.tpl,
##                admin/admin_user.php,
##                template/subSilver/admin/user_edit_body.tpl,
##                includes/usercp_viewprofile.php,
##                templates/subSilver/profile_view_body.tpl,
##                language/lang_english/lang_admin.php
## Included Files: A set of rank images.
## Generator: MODEdit by Andareed <and_a_reed@hotmail.com>
########################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Notes:
## Revision History:
##
## Version 1.01:
## Added rank images in view profile.
##
## Version 1.00:
## First stable release.
##
## Version 0.14:
## Fixed some minor bugs.
##
## Version 0.13:
## Fixed some bugs.
##
## Version 0.12:
## Added Admin Panel Support
## Changed level2 into rank2
##
## Version 0.1:
## First release
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE phpbb_users ADD user_rank2 INT(11) AFTER user_rank;
UPDATE phpbb_users SET user_rank2 = "0";
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_from_flag, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_allow_viewonline, u.user_session_time, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid, t.style_name
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, u.user_rank
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, u.user_rank2
#
#-----[ FIND ]------------------------------------------
#
            $poster_rank = $ranksrow[$j]['rank_title'];
            $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
         }
      }
   }
#
#-----[ AFTER, ADD ]------------------------------------------
#
   //
   // Rank 2 Begin
   //
   $poster_rank2 = '';
   $rank2_image = '';
   if ( $postrow[$i]['user_id'] == ANONYMOUS )
   {
   }
   else if ( $postrow[$i]['user_rank2'] )
   {
      for($j = 0; $j < count($ranksrow); $j++)
      {
         if ( $postrow[$i]['user_rank2'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] )
         {
            $poster_rank2 = $ranksrow[$j]['rank_title'];
            $rank2_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank2 . '" title="' . $poster_rank2 . '" border="0" /><br />' : '';
         }
      }
   }
   //
   // Rank 2 End
   //
#
#-----[ FIND ]------------------------------------------
#
   'POSTER_RANK' => $poster_rank,
   'RANK_IMAGE' => $rank_image,
#
#-----[ AFTER, ADD ]------------------------------------------
#
   'POSTER_RANK2' => $poster_rank2,
   'RANK2_IMAGE' => $rank2_image,
#
#-----[ OPEN ]------------------------------------------
#
template/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
   {postrow.RANK_IMAGE}<br /><br />
#
#-----[ AFTER, ADD ]------------------------------------------
#
   {postrow.POSTER_RANK2}<br />{postrow.RANK2_IMAGE}<br />
#
#-----[ OPEN ]------------------------------------------
#
memberlist.php
#
#-----[ FIND ]------------------------------------------
#
'L_ICQ' => $lang['ICQ'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_USER_RANK' => $lang['Poster_rank'],
#
#-----[ FIND ]------------------------------------------
#
$order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page'];
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Rank Begin
//
$sql = "SELECT *
   FROM " . RANKS_TABLE . "
   ORDER BY rank_special, rank_min";
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql);
}
$ranksrow = array();
while ( $row = $db->sql_fetchrow($result) )
{
   $ranksrow[] = $row;
}
$db->sql_freeresult($result);
//
// Rank End
//
#
#-----[ FIND ]------------------------------------------
#
, user_allowavatar
#
#-----[ AFTER, ADD ]------------------------------------------
#
, user_rank , user_rank2
#
#-----[ FIND ]------------------------------------------
#
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
#
#-----[ AFTER, ADD ]------------------------------------------
#
      //
      // Rank Begin
      // Generate ranks, set them to empty string initially.
      //
      $user_rank = '';
      $rank_image = '';
      if ( $row['user_rank'] )
      {
         for($j = 0; $j < count($ranksrow); $j++)
         {
            if ( $row['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] )
            {
               $user_rank = $ranksrow[$j]['rank_title'];
               $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $user_rank . '" title="' . $user_rank . '" border="0" /><br />' : '';
            }
         }
      }
      else
      {
         for($j = 0; $j < count($ranksrow); $j++)
         {
            if ( $row['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special'] )
            {
               $user_rank = $ranksrow[$j]['rank_title'];
               $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $user_rank . '" title="' . $user_rank . '" border="0" /><br />' : '';
            }
         }
      }
      //
      // Rank End
      //

      //
      // Rank 2 Begin
      // Generate ranks, set them to empty string initially.
      //
      $user_rank2 = '';
      $rank2_image = '';
      if ( $row['user_rank2'] )
      {
         for($j = 0; $j < count($ranksrow); $j++)
         {
            if ( $row['user_rank2'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] )
            {
               $user_rank2 = $ranksrow[$j]['rank_title'];
               $rank2_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $user_rank2 . '" title="' . $user_rank2 . '" border="0" /><br />' : '';
            }
         }
      }
      //
      // Rank 2 End
      //
#
#-----[ FIND ]------------------------------------------
#
'JOINED' => $joined,
#
#-----[ AFTER, ADD ]------------------------------------------
#
   'USER_RANK' => $user_rank,
   'USER_RANK_IMG' => $rank_image,
   'USER_RANK2' => $user_rank2,
   'USER_RANK2_IMG' => $rank2_image,
#
#-----[ OPEN ]------------------------------------------
#
template/subSilver/memberlist_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<th class="thTop" nowrap="nowrap">{L_USERNAME}</th>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<th class="thTop" nowrap="nowrap">{L_USER_RANK}</th>
#
#-----[ FIND ]------------------------------------------
#
<td class="{memberrow.ROW_CLASS}" align="center"><span class="gen"><a href="{memberrow.U_VIEWPROFILE}" class="gen">{memberrow.USERNAME}</a></span></td>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<td class="{memberrow.ROW_CLASS}" align="center" valign="middle">
         <span class="gensmall">
            {memberrow.USER_RANK}<br />
            {memberrow.USER_RANK_IMG}
            {memberrow.USER_RANK2}<br />
            {memberrow.USER_RANK2_IMG}
         </span>
      </td>
#
#-----[ FIND ]------------------------------------------
#
<td class="catbottom" colspan="8" height="28">&nbsp;</td>
#
#-----[ REPLACE WITH ]------------------------------------------
#
// Just add one to colspan value
<td class="catbottom" colspan="9" height="28">&nbsp;</td>
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_user.php
#
#-----[ FIND ]------------------------------------------
#
$user_rank = ( !empty($HTTP_POST_VARS['user_rank']) ) ? intval( $HTTP_POST_VARS['user_rank'] ) : 0;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_rank2 = ( !empty($HTTP_POST_VARS['user_rank2']) ) ? intval( $HTTP_POST_VARS['user_rank2'] ) : 0;
#
#-----[ FIND ]------------------------------------------
#
user_active = $user_status
#
#-----[ AFTER, ADD ]------------------------------------------
#
, user_rank2 = $user_rank2
#
#-----[ FIND ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="user_allowavatar" value="' . $user_allowavatar . '" />';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="user_rank2" value="' . $user_rank2 . '" />';
#
#-----[ FIND ]------------------------------------------
#
         $selected = ( $this_userdata['user_rank'] == $rank_id ) ? ' selected="selected"' : '';
         $rank_select_box .= '<option value="' . $rank_id . '"' . $selected . '>' . $rank . '</option>';
      }
#
#-----[ AFTER, ADD ]------------------------------------------
#
      //
      // Rank 2 Begin
      //
      $sql = "SELECT * FROM " . RANKS_TABLE . "
         WHERE rank_special = 1
         ORDER BY rank_title";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not obtain ranks data', '', __LINE__, __FILE__, $sql);
      }
      $rank2_select_box = '<option value="0">' . $lang['No_assigned_rank'] . '</option>';
      while( $row = $db->sql_fetchrow($result) )
      {
         $rank = $row['rank_title'];
         $rank_id = $row['rank_id'];
         
         $selected = ( $this_userdata['user_rank2'] == $rank_id ) ? ' selected="selected"' : '';
         $rank2_select_box .= '<option value="' . $rank_id . '"' . $selected . '>' . $rank . '</option>';
      }
      //
      // Rank 2 End
      //
#
#-----[ FIND ]------------------------------------------
#
'RANK_SELECT_BOX' => $rank_select_box,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'RANK2_SELECT_BOX' => $rank2_select_box,
#
#-----[ FIND ]------------------------------------------
#
'L_SELECT_RANK' => $lang['Rank_title'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_SELECT_RANK2' => $lang['Rank2_title'],
#
#-----[ OPEN ]------------------------------------------
#
template/subSilver/admin/user_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
   <tr>
      <td class="row1"><span class="gen">{L_SELECT_RANK}</span></td>
      <td class="row2"><select name="user_rank">{RANK_SELECT_BOX}</select></td>
   </tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
   <tr>
      <td class="row1"><span class="gen">{L_SELECT_RANK2}</span></td>
      <td class="row2"><select name="user_rank2">{RANK2_SELECT_BOX}</select></td>
   </tr>
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
         $rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
      }
   }
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
   //
   // Rank 2 Begin
   //
   $poster_rank2 = '';
   $rank2_image = '';
   if ( $profiledata['user_rank2'] )
   {
      for($i = 0; $i < count($ranksrow); $i++)
      {
         if ( $profiledata['user_rank2'] == $ranksrow[$i]['rank_id'] && $ranksrow[$i]['rank_special'] )
         {
            $poster_rank2 = $ranksrow[$i]['rank_title'];
            $rank2_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank2 . '" title="' . $poster_rank2 . '" border="0" /><br />' : '';
         }
      }
   }
   //
   // Rank 2 End
   //
#
#-----[ FIND ]------------------------------------------
#
   'POSTER_RANK' => $poster_rank,
   'RANK_IMAGE' => $rank_image,

#
#-----[ AFTER, ADD ]------------------------------------------
#
   'POSTER_RANK2' => $poster_rank2,
   'RANK2_IMAGE' => $rank2_image,
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<span class="postdetails">{POSTER_RANK}
#
#-----[ AFTER, ADD ]------------------------------------------
#
{RANK_IMAGE}<br />{POSTER_RANK2}<br />{RANK2_IMAGE}
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Rank_title'] = "Rank Title";
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Rank2_title'] = "Rank 2 Title";
#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------------
#
 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Virgin_Steel







PostPosted: Sun Feb 13, 2005 6:06 pm Reply with quote

ok i just found it...
I don't know why in some cases php on Nuke use
modules/Forums/templates/...
in other
themes/DeepBlue/forums/....

Now when i edit user_edit_body in modules/Forums/templates/... it works...but
It doesnt show my special rank(site admin)just regular(depended on posts) if i don't choose second special rank...if i choose another special rank it shows the first!Sad(
So any Ideas?
 
Virgin_Steel







PostPosted: Sun Feb 13, 2005 6:34 pm Reply with quote

Ok everything's fine now:) sorry for this flood, i cant believe i've fix it by myself:))
You can delete this topic...
Instead of flood It is cool hack for the purpose i said above!
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.0

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©