Перейти к контенту

Reputation System 3.0 Release Candidate 1


d1pro

Рекомендуемые сообщения

ну дык как смайлы исправить ?[1118932015:1118935369]Еще "Моя репутация" около "Личных сообщений" отсутствует !

В ленге есть пункт 'rep_my' => "Моя репутация", а вот в коде мода его нет !

Ссылка на комментарий
Поделиться на других сайтах

  • Ответы 825
  • Создана
  • Последний ответ

Лучшие авторы в этой теме

Лучшие авторы в этой теме

  • d1pro

    d1pro 143 публикации

  • Anna

    Anna 40 публикаций

  • SAT

    SAT 34 публикации

  • Monah

    Monah 33 публикации

Загружено фотографий

d1pro

 

Дык я понял что "Моя репутация" прописываеться в /sources/classes/class_display.php ! Или нет ?

Я обновлял 2-ую бета версию - запустил инсталл, сделал исправления в class_display.php и шаблоны ребилдил ! Но "Моя репутация" не появилась !

Ссылка на комментарий
Поделиться на других сайтах

Нет, не в class_display. Там только добавляется ее поведение - т.е. делать красным или нет. А так в скинах добавляется. All Global HTML
Ссылка на комментарий
Поделиться на других сайтах

Mixa, у меня аналогичная фигня. Я поправила class_display на свой вкус. Чтобы если не было измений, выводилось rep_my а если есть, то rep_my_new.[1118955958:1118956021]А апдейт я запускала, ребилд шаблонов делала... но все как пропало, так и не появилось, пока вот ручками не подправила класс дисплея.
Ссылка на комментарий
Поделиться на других сайтах

Тьфу, блин... Строчку в инструкции пропустил

Должно быть так в class_display:

                $msg_data['REP'] = $ibforums->lang['rep_my'];

               if ( $ibforums->member['id'] )
               {
                        $last_visit = max( intval( $ibforums->member['last_visit'] ), intval( $std->my_getcookie('rep_last_visit') ) );
                        $tmp = $DB->simple_exec_query ( array ( 'select' => 'count(*) as new_rep', 'from' => 'reputation', 'where' => 'member_id='.intval($ibforums->member['id'])." AND msg_date >= ".$last_visit ) );
                        if ( $tmp['new_rep'] ) $msg_data['REP'] = sprintf( $ibforums->lang['rep_my_new'], $tmp['new_rep']);
               }

Ссылка на комментарий
Поделиться на других сайтах

а там так можно:

у каждого юзера есть его статус (3 квадратика там или 4..) и есть соответствующее число пойнтов, которое он может распределять между пользователями без объяснения причин. Изменилось отношение к юзеру снял свой пойнт - отдал другому, или вообще оставил про запас. И за снятие обидно никому не обидно было бы. В результате в минус загнать никого не удастся и баловаться слишком много не получится, и стимул к повышению статуса и своей активности.

Ссылка на комментарий
Поделиться на других сайтах

Прочитал бы тему, поэкспериментировал сам бы... Ну я не знаю...

Судя по тому, как отображается, у тебя включен режим Звание+число, а звания не настроены.

Ссылка на комментарий
Поделиться на других сайтах

Вопрос. Никто не подскажет как сделать чтоб в топикебыла не просто одна цифра а сколько проголосовало + и сколько - ? Вроде вот такого

Подано 53 (49/4) голосов

Ссылка на комментарий
Поделиться на других сайтах

Не очень понятен данный момент. Надеюсь, кто-нибудь поможет. Просто уточнить хочется.

Кусок из ReadMe:

 

"//-----------

// ADD BELOW !!!!!!!

//-----------

 

//-----------------------------------------

//

// REPUTATION RANKS...

//

//-----------------------------------------

 

function rep_rank_recache()

{

global $ibforums, $DB, $std;

 

$ibforums->cache['reputation_ranks'] = array();

 

$DB->simple_construct( array( 'select' => '*',

'from' => 'reput_ranks',

) );

 

$DB->simple_exec();

 

while ($i = $DB->fetch_row())

{

$ibforums->cache['reputation_ranks'][ $i['id'] ] = array(

'TITLE' => $i['title'],

'PIPS' => $i['pips'],

'AMOUNT' => $i['amount'],

'CODE' => $i['code'],

);

}

 

if (is_array ($ibforums->cache['reputation_ranks']))

{

usort ($ibforums->cache['reputation_ranks'], array( 'ad_member', 'rep_sort_special' ));

}

 

$std->update_cache( array( 'name' => 'reputation_ranks', 'array' => 1, 'deletefirst' => 1 ) );

}

 

function rep_sort_special ($a, $:D

{

if ($a['AMOUNT'] == $b['AMOUNT']) return 0;

if ($a['AMOUNT'] * $b['AMOUNT'] <= 0)

{

return ($a['AMOUNT'] > $b['AMOUNT']) ? -1 : 1;

}

else if ( $a['AMOUNT'] >= 0 and $b['AMOUNT'] >= 0 )

{

return ($a['AMOUNT'] > $b['AMOUNT']) ? -1 : 1;

}

else if ( $a['AMOUNT'] < 0 and $b['AMOUNT'] < 0 )

{

return ($a['AMOUNT'] < $b['AMOUNT']) ? -1 : 1;

}

}

 

function rep_rank_start()

{

global $ibforums, $DB, $std;

 

$ibforums->admin->page_title = "Member Reputation Ranking Set Up";

 

$ibforums->admin->page_detail = "This section allows you to modify, delete or add extra reputation ranks.<br>If you wish to display pips below the members name, enter the number of pips. If you wish to use a custom image, simply enter the image name in the pips box. Note, these custom images must reside in the 'style_images/{img_dir}/folder_team_icons' directory of your installation";

 

 

//-----------------------------------------

 

$ibforums->adskin->td_header[] = array( "Title" , "30%" );

$ibforums->adskin->td_header[] = array( "Min Posts" , "10%" );

$ibforums->adskin->td_header[] = array( "Pips" , "10%" );

$ibforums->adskin->td_header[] = array( "Type" , "10%" );

$ibforums->adskin->td_header[] = array( " " , "20%" );

$ibforums->adskin->td_header[] = array( " " , "20%" );

 

//-----------------------------------------

// Parse macro

//-----------------------------------------

 

$DB->simple_construct( array( 'select' => '*', 'from' => 'skin_sets', 'where' => "set_default=1" ) );

$DB->simple_exec();

 

$mid = $DB->fetch_row();

 

$DB->simple_construct( array( 'select' => 'macro_value, macro_replace', 'from' => 'skin_macro', 'where' => "macro_set=1 AND macro_value='R_STAR_GOOD' OR macro_value='R_STAR_BAD'" ) );

$DB->simple_exec();

 

while ( $row = $DB->fetch_row() )

{

$star[$row['macro_value']] = str_replace( "<#IMG_DIR#>", $mid['set_image_dir'], $row['macro_replace'] );

}

 

$ibforums->html .= $ibforums->adskin->start_table( "Reputation Titles/Ranks" );

 

//-----------------------------------------

// Lets get on with it...

//-----------------------------------------

 

$DB->simple_construct( array( 'select' => '*', 'from' => 'reput_ranks', 'order' => "amount" ) );

$DB->simple_exec();

 

while ( $r = $DB->fetch_row() )

{

$img = "";

 

if ( preg_match( "/^\d+$/", $r['pips'] ) )

{

$star['R_STAR'] = $r['code'] == '01' ? $star['R_STAR_GOOD'] : $star['R_STAR_BAD'];

 

for ($i = 1; $i <= $r['pips']; $i++)

{

$img .= $star['R_STAR'];

 

}

}

else

{

$img = "<img src='style_images/{$mid['set_image_dir']}/folder_team_icons/{$r['pips']}' border='0'>";

}

 

$r_type = $r['code'] == '01' ? 'Good' : 'Bad';

 

$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>".$r['title']."</b>" ,

$r['amount'],

$img,

$r_type,

"<a href='{$ibforums->adskin->base_url}&act=mem&code=rep_rank_edit&id={$r['id']}'>Edit</a>",

"<a href='{$ibforums->adskin->base_url}&act=mem&code=rep_rank_delete&id={$r['id']}'>Delete</a>",

) );

}

 

$ibforums->html .= $ibforums->adskin->end_table();

 

//-----------------------------------------

 

$ibforums->html .= $ibforums->adskin->start_form( array( 1 => array( 'code' , 'do_add_rep_rank' ),

2 => array( 'act' , 'mem' ),

) );

 

//-----------------------------------------

 

$ibforums->adskin->td_header[] = array( " " , "40%" );

$ibforums->adskin->td_header[] = array( " " , "60%" );

 

//-----------------------------------------

 

$code = array( 0 => array( '01', 'Good' ), 1 => array( '02', 'Bad' ) );

 

$ibforums->html .= $ibforums->adskin->start_table( "Add a Reputation Rank" );

 

 

$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>Rank Title</b>" ,

$ibforums->adskin->form_input( "title" )

) );

 

$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>Minimum number of reputation points needed</b>" ,

$ibforums->adskin->form_input( "amount" )

) );

 

$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>Number of pips</b><div class='graytext'>Or pip image - image must be uploaded into 'style_images/{img_dir}/folder_team_icons'</div>" ,

$ibforums->adskin->form_input( "pips" )

) );

 

$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>Use for what reputation</b><div class='graytext'>Allows usage of 2 different types of pips for both good and bad reputation</div>" ,

$ibforums->adskin->form_dropdown( "rtype", $code, "01" )

) );

 

 

$ibforums->html .= $ibforums->adskin->end_form("Add this rank");

 

$ibforums->html .= $ibforums->adskin->end_table();

 

$ibforums->admin->output();

}

 

//-----------------------------------------

 

function rep_rank_add_rank()

{

global $ibforums, $DB, $std;

 

//-----------------------------------------

// check for input

//-----------------------------------------

 

foreach( array( 'rtype', 'amount', 'title', 'pips' ) as $field )

{

if ($ibforums->input[ $field ] == "")

{

$ibforums->admin->error("You must complete the form fully");

}

}

 

//-----------------------------------------

// Add it to the DB

//-----------------------------------------

 

$DB->force_data_type = array( 'code' => 'string' );

 

$DB->do_insert( 'reput_ranks', array(

'amount' => trim($ibforums->input['amount']),

'title' => trim($ibforums->input['title']),

'pips' => trim($ibforums->input['pips']),

'code' => trim($ibforums->input['rtype']),

) );

 

$this->rep_rank_recache();

 

$ibforums->admin->done_screen("Reputation Rank Added", "Member Reputation Ranking Control", "act=mem&code=rep_rank", 'redirect' );

 

 

}

 

//-----------------------------------------

 

function rep_rank_delete_rank()

{

global $ibforums, $DB, $std;

 

//-----------------------------------------

// check for input

//-----------------------------------------

 

if ($ibforums->input['id'] == "")

{

$ibforums->admin->error("We could not match that ID");

}

 

$DB->simple_exec_query( array( 'delete' => 'reput_ranks', 'where' => "id='".$ibforums->input['id']."'" ) );

 

$this->rep_rank_recache();

 

$ibforums->admin->save_log("Removed Reputation Rank Setting");

 

$ibforums->admin->done_screen("Rank Removed", "Reputation Ranking Control", "act=mem&code=rep_rank", 'redirect' );

 

}

 

//-----------------------------------------

 

function rep_rank_edit_rank()

{

global $ibforums, $DB, $std;

 

//-----------------------------------------

// check for input

//-----------------------------------------

 

if ($ibforums->input['id'] == "")

{

$ibforums->admin->error("We could not match that ID");

}

 

//-----------------------------------------

 

foreach( array( 'rtype', 'amount', 'title', 'pips' ) as $field )

{

if ($ibforums->input[ $field ] == "")

{

$ibforums->admin->error("You must complete the form fully");

}

}

 

//-----------------------------------------

// Add it to the DB

//-----------------------------------------

 

$DB->force_data_type = array( 'code' => 'string' );

 

$DB->do_update( 'reput_ranks', array (

'amount' => trim($ibforums->input['amount']),

'title' => trim($ibforums->input['title']),

'pips' => trim($ibforums->input['pips']),

'code' => trim($ibforums->input['rtype']),

) , "id='".$ibforums->input['id']."'" );

 

$this->rep_rank_recache();

 

$ibforums->admin->save_log("Edited Rank Setting");

 

$ibforums->admin->done_screen("Reputation Rank Edited", "Reputation Ranking Control", "act=mem&code=rep_rank", 'redirect' );

 

 

}

 

//-----------------------------------------

 

function rep_rank_setup($mode='edit')

{

global $ibforums, $DB, $std;

 

$ibforums->admin->page_title = "Reputation Rank Set Up";

 

$ibforums->admin->page_detail = "If you wish to display pips below the members name, enter the number of pips. If you wish to use a custom image, simply enter the image name in the pips box. Note, these custom images must reside in the 'style_images/{img_dir}/folder_team_icons' directory of your installation";

 

if ($mode == 'edit')

{

$form_code = 'do_edit_rep_rank';

 

if ($ibforums->input['id'] == "")

{

$ibforums->admin->error("No rank ID was set, please try again");

}

 

$DB->simple_construct( array( 'select' => '*', 'from' => 'reput_ranks', 'where' => "id='".$ibforums->input['id']."'" ) );

$DB->simple_exec();

 

$rank = $DB->fetch_row();

 

$button = "Complete Edit";

}

else

{

$form_code = 'do_add_rep_rank';

$rank = array( 'posts' => "", 'title' => "", 'pips' => "");

$button = "Add this rank";

}

 

//-----------------------------------------

 

$ibforums->html .= $ibforums->adskin->start_form( array( 1 => array( 'code' , $form_code ),

2 => array( 'act' , 'mem' ),

3 => array( 'id' , $rank['id'] ),

) );

 

//-----------------------------------------

 

$ibforums->adskin->td_header[] = array( " " , "40%" );

$ibforums->adskin->td_header[] = array( " " , "60%" );

 

//-----------------------------------------

 

$code = array( 0 => array( '01', 'Good' ), 1 => array( '02', 'Bad' ) );

 

$ibforums->html .= $ibforums->adskin->start_table( "Reputation Ranks" );

 

 

$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>Rank Title</b>" ,

$ibforums->adskin->form_input( "title", $rank['title'] )

) );

 

$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>Minimum number of reputation points needed</b>" ,

$ibforums->adskin->form_input( "amount", $rank['amount'] )

) );

 

$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>Number of pips</b><div class='graytext'>Or pip image - image must be uploaded into 'style_images/{img_dir}/folder_team_icons'</div>" ,

$ibforums->adskin->form_input( "pips", $rank['pips'] )

) );

 

$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>Use for what reputation</b><div class='graytext'>Allows usage of 2 different types of pips for both good and bad reputation</div>" ,

$ibforums->adskin->form_dropdown( "rtype", $code, $rank['code'] )

) );

 

$ibforums->html .= $ibforums->adskin->end_form($button);

 

$ibforums->html .= $ibforums->adskin->end_table();

 

$ibforums->admin->output();

 

 

}

 

//-----------------------------------------

 

//-----------

// FIND

//-----------"

 

Так вот все что до FIND надо вставлять, по сути да, но там же внутри всякие Add it to the DB есть или они для скрипта?

Ссылка на комментарий
Поделиться на других сайтах

Вот такая вот ещё проблема:

 

" //-----------------------------------------

// Bye....

//-----------------------------------------

 

$ibforums->admin->redirect( $url, $text, 0, $time );

}

 

"

 

Проблема в том, что таких кусков в файле пруд пруди, идентичных. Куда добавлять то? В любую?

Ссылка на комментарий
Поделиться на других сайтах

У меня такая же проблема была. Просто идиентичных мест было много, и не знал куда вставлять... вставил просто в первое попавшееся) Так что неплохо бы было добавить в ридми указание, что здесь вставлять можно в любое место :D
Ссылка на комментарий
Поделиться на других сайтах

проблема при запуске форума после устанвке пишет-

--

mySQL query error: SELECT p.*,

m.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.rep, m.rep_all, m.allow_anon, m.allow_rep,

 

me.msnname,me.aim_name,me.icq_number,me.signature, me.website,me.yahoo,me.location, me.avatar_location, me.avatar_type, me.avatar_size,

pc.*

FROM ibf_posts p

LEFT JOIN ibf_members m ON (p.author_id=m.id)

LEFT JOIN ibf_member_extra me ON (me.id=m.id)

LEFT JOIN ibf_pfields_content pc ON (pc.member_id=p.author_id)

WHERE p.pid IN(15608,15641,15656,15690,15694,15708,15903,15950,15977,15980,15981,16011,16109

,16131,16178) ORDER BY pid asc

 

mySQL error: Unknown column 'm.rep_all' in 'field list'

mySQL error code:

Date: Friday 24th of June 2005 11:53:16 AM

--

 

Я так понял отсутвуют какие то колонки?

Как это можно решить?

 

а при установке запуске инсталл выдавал-

--

mySQL query error: ALTER TABLE `ibf_members` ADD `rep` int(10) NOT NULL default '0'

 

mySQL error: Duplicate column name 'rep'

mySQL error code:

Date: Friday 24th of June 2005 12:16:41 PM

--

Ссылка на комментарий
Поделиться на других сайтах


×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.