Hi!
Diese Modifikation ermöglicht es wenn ein User genügend Punke gesammelt hat, und er ein Bild hochladet dieses sofort Freigeschaltet wird.
Punkte werden vergeben für Bilder, Kommentare, und für Bildbewertung.
Wieviele Punkte für ein Ereignis vergeben werden könnt ihr in ACP unter Setting einstellen.
Wird das Feld "Ab wievielen Punkten gilt der User als Vertrauenswürdig?" leer gelassen ist der Mod deaktiviert.
Wird eines der anderen Felder leer gelassen werden die dafür entsprechenden Punkte nicht vergeben.
als User kann man seine Punkte im "Kontrollzentrum" sehen.
Wenn die erforderlichen Punke erreicht sind wird eine Meldung angezeigt.
zu Modifizierende Dateien:
1.) eine neues Feld in der "User Tabelle"
2.) deinen Template/ member_editprofile.html
3.) lang/main.php
4.) lang/admin.php
5.) admin/settings.php
6.) admin/users.php
7.) includes/page_header.php
8.) root/member.php
Optional 9.) : deinen Template/member_profile.html
1.) ladet euch aus dem anhang die datei "user_trusted_install" herrunter, speichert sie in euren root ab und führt sie aus.
2.) suche in deinen Template/ member_editprofile.html:
{lang_no}
</td>
</tr>
füge darunter ein:
{if user_trusted_sum}
<tr height="22">
<td class="row2"><b>{lang_user_score}</b></td>
<td class="row2">{user_counter_msg}</td>
</tr>
{ifno user_counter_msg}
<tr>
<td class="row2" ><b>0</b></td>
<td class="row2"align="right"><b>{trusted_max_score}</b></td>
</tr>
<tr>
<td colspan="2" class="row2">
<table align="left" border="0" cellspacing="1" cellpadding="1" width="{bar_in_width}%">
<tr>
<td style="background-color:{bar_in_color};text-align:right"><b>{user_trusted_sum}</b> </td>
</tr>
</table>
</td>
</tr>
{endifno user_counter_msg}
{endif user_trusted_sum}
3.) suche in lang/(your Lang)/main.php
//-----------------------------------------------------
//--- Paging ------------------------------------------
füge darüber ein:
(deutsch)
//#################### START Mod Trusted Member ##############################
$lang['user_counter_msg'] = "Sie haben <b>{user_trusted_sum}</b> Punkte, Ihre Bilder werden sofort Freigeschaltet.";
$lang['user_trusted'] = "Vertrauenswürdiger Benutzer: ";
$lang['user_score'] = "Punktestand: ";
//#################### END Mod Trusted Member ################################
(english)
//#################### START Mod Trusted Member ##############################
$lang['user_counter_msg'] = "You have <b>{user_trusted_sum}</b> Points, Your images will activated immediately.";
$lang['user_trusted'] = "Trusted User: ";
$lang['user_score'] = "Score: ";
//#################### END Mod Trusted Member ################################
4.) suche in lang/yourLang/admin.php:
(Deutsch)
$setting_group[7]="Session und User Einstellungen";
füge darunter ein:
$setting['user_trusted_counter'] = "Ab wievielen Punkten gilt der User als Vertrauenswürdig?";
$setting['user_trusted_images'] = "Wievielen Punkte für ein Bild:";
$setting['user_trusted_comments'] = "Wievielen Punkte für einen Kommentar:";
$setting['user_trusted_rating'] = "Wievielen Punkte für eine Bewertung:";
(english)
$setting['user_trusted_counter'] = "From how many points the user is considered to be trustworthy?";
$setting['user_trusted_images'] = "How many points for a picture:";
$setting['user_trusted_comments'] = "How many points for a comment:";
$setting['user_trusted_rating'] = "How many points for a review:";
5.) suche in admin/settings.php:
show_table_separator($setting_group[7], 2, "setting_group_7");
füge darunter ein:
//#################### START Mod Trusted Member ##############################
show_setting_row("user_trusted_counter");
show_setting_row("user_trusted_images");
show_setting_row("user_trusted_comments");
show_setting_row("user_trusted_rating");
//#################### END Mod Trusted Member ###############################
6.) suche in admin/users.php:
$user_lastaction = ($user_lastaction != "") ? "UNIX_TIMESTAMP('$user_lastaction')" : time();
füge darunter ein:
//#################### START Mod Trusted Member ##############################
$user_trusted_counter = $HTTP_POST_VARS['user_trusted_sum'] + $HTTP_POST_VARS['user_trusted_neg'];
//#################### END Mod Trusted Member ################################
6.1) suche:
SET ".get_user_table_field("", "user_level")." = $user_level, ".get_user_table_field("", "user_name")." = '$user_name',$passinsert ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_joindate")." = $user_joindate, ".get_user_table_field("", "user_lastaction")." = $user_lastaction, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql."
ersetze es mit:
SET ".get_user_table_field("", "user_level")." = $user_level, ".get_user_table_field("", "user_name")." = '$user_name',$passinsert ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_joindate")." = $user_joindate, ".get_user_table_field("", "user_lastaction")." = $user_lastaction, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq', user_trusted_counter = '$user_trusted_counter' ".$additional_sql."
6.2) suche:
show_date_input_row($lang['field_lastaction'].$lang['date_desc'], "user_lastaction", $user_row['user_lastaction'], $textinput_size);
füge darunter ein:
//#################### START Mod Trusted Member ##############################
if (!empty($config['user_trusted_counter'])){
$sql = "SELECT COUNT(image_id) AS num_images
FROM ".IMAGES_TABLE."
WHERE user_id = ".$user_row['user_id']."
";
$count_row = $site_db->query_firstrow($sql);
$user_trusted_images = $count_row['num_images']*$config['user_trusted_images'];
$user_trusted_comments = (!empty($config['user_trusted_comments'])) ? $user_row['user_comments']*$config['user_trusted_comments'] : 0;
$user_trusted_counter = (!empty($config['user_trusted_rating'])) ? $user_row['user_trusted_counter'] : 0;
$user_trusted_sum = $user_trusted_images + $user_trusted_comments + $user_trusted_counter;
$user_trusted_neg = - $user_trusted_images - $user_trusted_comments;
show_input_row($lang['user_score'], "user_trusted_sum", $user_trusted_sum);
show_hidden_input("user_trusted_neg", $user_trusted_neg);
}
//#################### END Mod Trusted Member #################################
7.) suche in includes/page_header.php:
$msg = $lang['voting_success'];
füge darunter ein:
//#################### START Mod Trusted Member ##############################
if(!empty($config['user_trusted_rating'])){
$sql = "UPDATE ".USERS_TABLE."
SET user_trusted_counter = (".$user_info['user_trusted_counter']." + ".$config['user_trusted_rating'].")
WHERE user_id = ".$user_info['user_id']."";
$site_db->query($sql);
}
//#################### END Mod Trusted Member ################################
8.) suche in root/member.php
$direct_upload = (check_permission("auth_directupload", $cat_id)) ? 1 : 0;
füge darunter ein:
//#################### START Mod Trusted Member ##############################
if (!empty($config['user_trusted_counter']) && ($cat_cache[$cat_id]['auth_directupload'] == AUTH_ADMIN)){
$sql = "SELECT COUNT(image_id) AS num_images
FROM ".IMAGES_TABLE."
WHERE user_id = ".$user_info['user_id']."
";
$count_row = $site_db->query_firstrow($sql);
$user_trusted_images = $count_row['num_images']*$config['user_trusted_images'];
$user_trusted_comments = (!empty($config['user_trusted_comments'])) ? $user_info['user_comments']*$config['user_trusted_comments'] : 0;
$user_trusted_counter = (!empty($config['user_trusted_rating'])) ? $user_info['user_trusted_counter'] : 0;
$user_trusted_sum = $user_trusted_images + $user_trusted_comments + $user_trusted_counter;
if(($direct_upload == 0) && ($user_trusted_sum >= $config['user_trusted_counter'])){
$direct_upload = 1;
}
}
//#################### END Mod Trusted Member ################################
8.1) suche:
$edit_profile_msg .= $lang['edit_profile_email_msg_admin'];
}
füge darunter ein:
//#################### START Mod Trusted Member ##############################
$user_trusted_sum = "";
$user_counter_msg = "";
if (!empty($config['user_trusted_counter'])){
if (!empty($config['user_trusted_images'])){
$sql = "SELECT COUNT(image_id) AS num_images
FROM ".IMAGES_TABLE."
WHERE user_id = ".$user_info['user_id']."
";
$count_row = $site_db->query_firstrow($sql);
$user_trusted_images = $count_row['num_images'] * $config['user_trusted_images'];
}
else{
$user_trusted_images = 0;
}
$user_trusted_comments = (!empty($config['user_trusted_comments'])) ? $user_info['user_comments']*$config['user_trusted_comments'] : 0;
$user_trusted_counter = (!empty($config['user_trusted_rating'])) ? $user_info['user_trusted_counter'] : 0;
$user_trusted_sum = $user_trusted_images + $user_trusted_comments + $user_trusted_counter;
if($user_trusted_sum != 0){
$bar_width = 100;
$bar_in_width = $bar_width/($config['user_trusted_counter']/$user_trusted_sum);
if($bar_in_width >= 95) {
$bar_in_color = "#00FF00";
}
else {
$bar_in_color= "#FF0000";
}
$bar_in_width = ($bar_in_width >= 100)?100:$bar_in_width;
$user_counter_msg = ($bar_in_width >= 100) ? $lang['user_counter_msg']:"";
}
$site_template->register_vars(array(
"bar_in_width" => $bar_in_width,
"bar_in_color" => $bar_in_color,
"trusted_max_score" => $config['user_trusted_counter'],
"lang_user_score" => $lang['user_score'],
"user_counter_msg" =>str_replace('{user_trusted_sum}', $user_trusted_sum, $user_counter_msg),
));
}
//#################### END Mod Trusted Member ##############################
8.2) suche:
"user_name" => format_text(stripslashes($user_name), 2),
füge darüber ein:
"user_trusted_sum" => $user_trusted_sum,
Optional: Damit andere User den Punktestand sehen können.
9.) suche in deinen Template/member_profile.html:
<td class="row2">{if user_icq}<a href="http://www.icq.com/people/about_me.php?uin={user_icq}" target="_blank">{user_icq}</a> (<b>{user_icq_status}</b>){endif user_icq}</td>
</tr>
füge darunter ein:
{if user_trusted_sum}
<tr height="22">
<td class="row1"><b>{lang_user_score}</b></td>
<td class="row1">{user_counter_msg}</td>
</tr>
{ifno user_counter_msg}
<tr>
<td class="row2" ><b>0</b></td>
<td class="row2"align="right"><b>{trusted_max_score}</b></td>
</tr>
<tr>
<td colspan="2" class="row2">
<table align="left" border="0" cellspacing="1" cellpadding="1" width="{bar_in_width}%">
<tr>
<td style="background-color:{bar_in_color};text-align:right"><b>{user_trusted_sum}</b> </td>
</tr>
</table>
</td>
</tr>
{endifno user_counter_msg}
{endif user_trusted_sum}
10.) suche in member.php:
$user_email_button = REPLACE_EMPTY;
}
$site_template->register_vars(array(
ersetze es mit:
$user_email_button = REPLACE_EMPTY;
}
//######################### Start Trusted Member ###########################
$user_trusted_sum = "";
$user_counter_msg = "";
if (!empty($config['user_trusted_counter'])){
if (!empty($config['user_trusted_images'])){
$sql = "SELECT COUNT(image_id) AS num_images
FROM ".IMAGES_TABLE."
WHERE user_id = ".$user_row['user_id']."
";
$count_row = $site_db->query_firstrow($sql);
$user_trusted_images = $count_row['num_images'] * $config['user_trusted_images'];
}
else{
$user_trusted_images = 0;
}
$user_trusted_comments = (!empty($config['user_trusted_comments'])) ? $user_row['user_comments']*$config['user_trusted_comments'] : 0;
$user_trusted_counter = (!empty($config['user_trusted_rating'])) ? $user_row['user_trusted_counter'] : 0;
$user_trusted_sum = $user_trusted_images + $user_trusted_comments + $user_trusted_counter;
if($user_trusted_sum != 0){
$bar_width = 100;
$bar_in_width = $bar_width/($config['user_trusted_counter']/$user_trusted_sum);
if($bar_in_width >= 95) {
$bar_in_color = "#00FF00";
}
else {
$bar_in_color= "#FF0000";
}
$bar_in_width = ($bar_in_width >= 100)?100:$bar_in_width;
$user_counter_msg = ($bar_in_width >= 100) ? $lang['user_counter_msg']:"";
}
$site_template->register_vars(array(
"bar_in_width" => $bar_in_width,
"bar_in_color" => $bar_in_color,
"trusted_max_score" => $config['user_trusted_counter'],
"lang_user_score" => $lang['user_score'],
"user_counter_msg" =>str_replace('{user_trusted_sum}', $user_trusted_sum, $user_counter_msg),
));
}
//######################### End Trusted Member ###########################
$site_template->register_vars(array(
"user_trusted_sum" => $user_trusted_sum,
mfg Andi