In-My-Opinion.org

»PhpBB mod (freeware): Persistent Avatars + Avatar Toplist«







You must add:

#
#-----[ OPEN ]----------------------------------------- 

posting.php


#-----[ FIND ]----------------------------------------- 

                
submit_merged_post($last_post_id$forum_id$subject$message$return_message$return_meta);


#-----[ REPLACE WITH ]----------------------------------------- 

                
submit_merged_post($mode$last_post_id$forum_id$subject$message$return_message$return_meta); 



and for includes/function_posts.php (at the beginning)


#
#-----[ FIND ]----------------------------------------- 

function submit_merged_post($post_id$forum_id$subject$message, &$return_message, &$return_meta)
{
    global 
$board_config$db$lang$phpEx$phpbb_root_path;


#-----[ REPLACE WITH ]----------------------------------------- 

function submit_merged_post(&$mode$post_id$forum_id$subject$message, &$return_message, &$return_meta)
{
    global 
$userdata$board_config$db$lang$phpEx$phpbb_root_path



and for includes/function_posts.php (at the end)


#-----[ FIND ]------------------------------------------ 

    
$sql = ($mode != "editpost") ? "INSERT INTO " POSTS_TABLE " (topic_id, forum_id, poster_id, post_username, post_time, post_created, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " $userdata['user_id'] . ", '$post_username', $current_time, $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" "UPDATE " POSTS_TABLE " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" $edited_sql " WHERE post_id = $post_id";


#-----[ REPLACE WITH ]------------------------------------------ 
#
    
$ava1 $userdata['user_avatar'];
    
$ava2 $userdata['user_avatar_type'];
    
$sql = ($mode != "editpost") ? "INSERT INTO " POSTS_TABLE " (topic_id, forum_id, poster_id, post_username, post_time, post_created, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig, user_avatar, user_avatar_type) VALUES ($topic_id, $forum_id, " $userdata['user_id'] . ", '$post_username', $current_time, $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig, '$ava1', '$ava2')" "UPDATE " POSTS_TABLE " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" $edited_sql " WHERE post_id = $post_id"



the original code for functions_post.php will be replaced with


#-----[ FIND ]------------------------------------------ 

#add_search_words
        
$sql "UPDATE " POSTS_TABLE " SET post_time = $current_time WHERE post_id = $post_id";
        
$result $db->sql_query($sql) or message_die(GENERAL_ERROR'Could not update last post time'''__LINE____FILE__$sql);


#-----[ REPLACE WITH ]------------------------------------------ 
#
// Avatar Suite MOD * http://www.1-4a.com
    
if (($mode == 'newtopic') || ($mode == 'reply'))
    {
        
$ava1 $userdata['user_avatar'];
        
$ava2 $userdata['user_avatar_type'];
        
$sql_avatarsuite "UPDATE " POSTS_TABLE " SET post_time = $current_time, user_avatar = '$ava1', user_avatar_type = '$ava2' WHERE post_id = $post_id";
        
$result $db->sql_query($sql_avatarsuite) or message_die(GENERAL_ERROR'Could not update forum post sticky avatar'''__LINE____FILE__$sql_avatarsuite);
    } else {
        
$sql "UPDATE " POSTS_TABLE " SET post_time = $current_time WHERE post_id = $post_id";
        
$result $db->sql_query($sql) or message_die(GENERAL_ERROR'Could not update last post time'''__LINE____FILE__$sql);
    }
// Avatar Suite END 



As you can see I have also added the avatar update to the normal post update due to performance reasons. Wink


if you have also installed the DELETE UNUSED AVATARS mod, then you must change this mod according also to run correctly with this mod.

## EasyMod compliant
############################################################## 
## MOD Title: Unused Avatars Delete change for Avatar Suite by knnknn
## MOD Author: Loeffel < www.loeffelinfo.de > (N/A) http://www.loeffelinfo.de/
## MOD Description: This mod makes sure that also the avatars are checked which are mentioned in the posts table.
##
## MOD Version: 1.0.0
## 
## Installation Level: easy
## Installation Time: 2 Minutes 
## Files To Edit: admin/admin_avatar_delete.php
##
## Included Files: n/a
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/ 
############################################################## 
## Author Notes: 
## 
## The original mod just looked into the users table, so it stated all avatars
## used only through the posts table as unused. 
## This mod corrects this behavior
## 
############################################################## 

#
#-----[ OPEN ]----------------------------------------- 

admin/admin_avatar_delete.php


#-----[ FIND ]----------------------------------------- 

$sql "SELECT COUNT( * ) AS total FROM " $table_prefix "users WHERE user_avatar = '" $file "'";
if ( !(
$result $db->sql_query($sql)) )
{
message_die(GENERAL_MESSAGE$lang['Avatar_Delete_7'], ''__LINE____FILE__$sql);
}
$row $db->sql_fetchrow($result);
if(
$row['total'] > 0)
continue;
// Ignore following files End


#-----[ REPLACE WITH ]----------------------------------------- 

        //check users avatars, to remove avatars of users who have never posted
        
$sql "SELECT COUNT( * ) AS total FROM " $table_prefix "users WHERE user_avatar = '" $file "'";
        if ( !(
$result $db->sql_query($sql)) )
        {
            
message_die(GENERAL_MESSAGE$lang['Avatar_Delete_7'], ''__LINE____FILE__$sql);
        }
        
$row $db->sql_fetchrow($result);
        
$totalavatars $row['total'];

        
//check posting avatars
        
$sql "SELECT COUNT( * ) AS total FROM " $table_prefix "posts WHERE user_avatar = '" $file "'";
        if ( !(
$result $db->sql_query($sql)) )
        {
            
message_die(GENERAL_MESSAGE$lang['Avatar_Delete_7'], ''__LINE____FILE__$sql);
        }
        
$row $db->sql_fetchrow($result);
        
$totalavatars $totalavatars $row['total'];

        if(
$totalavatars 0)
            continue;
        
// Ignore following files End


#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 

# EoM 



I hope it is understandable, if not ask. Wink


posted by Loeffel
  Yours

Loeffel

in-my-opinion.org -> Technology, Computers, Science, Internet -> Software by the admin -> phpBB mod (freeware): Persistent Avatars + Avatar Toplist



Loeffel:
I hope it is understandable, if not ask.

Thank you very much! Thumb Up
Were more changes than I have expected.


posted by knn
  



No problem, why shouldn't I share my knowledge? I hope it will be useful for someone having the same problem. Wink

I could search for my own, but perhaps you know where to change. Wink
If I would use the voting option I would like to see bad / average / good / top instead of -1 / 0 / 1 / 2 in the toplist. Do you know where it is to be changed?

posted by Loeffel
  



Loeffel:
If I would use the voting option I would like to see bad / average / good / top instead of -1 / 0 / 1 / 2 in the toplist. Do you know where it is to be changed?

Actually I don't what you mean. In the toplist you see averages. Something like "0.8 points"


posted by knn
  



That's right, but on the right side there are two things.
First what someone wrote to a voting and with what value he is posting (can this be seen by everyone or just by the admin?) this value is just shown as an numeric value.

posted by Loeffel
  



Loeffel:
First what someone wrote to a voting and with what value he is posting (can this be seen by everyone or just by the admin?) this value is just shown as an numeric value.

That can only be seen by the admin.


posted by knn
  



Where must I change the code to get texts for it? You know I'm a lazy guy and why need to think what the value means. Wink

posted by Loeffel
  



Loeffel:
Where must I change the code to get texts for it? You know I'm a lazy guy and why need to think what the value means.

OK, I have updated the code. You can download the mod again. You just need to upload "avatarsuite_toplist.php".


posted by knn
  



Cool thanks!

Now I should return to my real problem, the notification mails. some are send and some doesnīt seem to be send. Sad

posted by Loeffel
  



When using this mod I am getting the following error trying to access avatarsuite_toplist.php, specifically

Fatal error: Call to a member function on a non-object in /home/betrayth/public_html/forum/includes/page_header.php on line 633


and here is the line from page_header.php

$s_last_visit = $userdata['session_logged_in'] ? $user->date($userdata['user_lastvisit']) : '';


interestingly enough I do not get that error when accessing the other two php files that come with this mod.

Thanks.


posted by RMcGirr
  



RMcGirr:
When using this mod I am getting the following error trying to access avatarsuite_toplist.php

Did you install the mod correctly? I mean adding the mod lines to page_header.php?


posted by knn
  



According to the mod I only needed to add those to have a link to avatar toplist on every page...which I didn't want.

Did I not read the instructions correctly?

#
#-----[ OPEN ]-----------------------------------------
#
# Note: You only need to edit this file, if you plan to have a link to the avatar toplist on every page
#
includes/page_header.php

#


Thanks for the reply.


posted by RMcGirr
  



Hi,

I havenīt got access to the mod right now, but normally you also need to modify the templates/subSilver/overall_heder.tpl file.

posted by Loeffel
  



Uhmmm, I don't want a link on every page which, if I am understanding what I am reading, is what the edits to page_header.php and overall_header.tpl do.

I just want to be able to view all the avatars on the site.

Thanks.

posted by RMcGirr
  



Thatīs right. So just donīt make the modification to the overall_header.tpl and the page_header.php

You can make a normal link inside the forum somewhere to
avatarsuite_listavatars.php
or
avatarsuite_toplist.php
that will make it. Wink

posted by Loeffel
  



Goto page Previous  
1, 2, 3, 4, 5, 6, 7  Next

Reply to topic
Goto page Previous  
1, 2, 3, 4, 5, 6, 7  Next






RegisterRegister
Log inLog in
The time now is 12 March 2010, 15:28
php B.B.