代碼: 選擇全部
##############################################################
## MOD Title: Photo Album Add-on: Display Pictures in Profile and on Posts
## MOD Author: Denzo <denzo@xboxcovers.net> [if any support needed mail me]
## MOD Description: Displays the amount of pictures in the left sidebar of
## a post and in the profile.
## MOD Version: 1.0.2
##
## Installation Level: super-easy
## Installation Time: 2 Minutes
## Files To Edit:
## viewtopic.php
## includes/usercp_viewprofile.php
## Included Files: n/a
## Log:
## 1.0.0- First version
## 1.0.1- Made compatible with subSilver template
## 1.0.2- Better querying
##############################################################
## WARNING:
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $postrow[$i]['user_posts'] : '';
#
#-----[ AFTER, ADD ]------------------------------------
#
//Pictures: hack by DENZO
define('ALBUM_TABLE', $table_prefix.'album');
$query = "SELECT pic_username FROM " . ALBUM_TABLE . " WHERE pic_username='".$poster."'";
$query_result = @$db->sql_query($query);
$pictures = 0;
$pictures = $db->sql_numrows($query_result)
$poster_posts .= "<br />Pictures: $pictures";
//Pictures: hack by DENZO
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
//
// Generate page
//
#
#-----[ BEFORE, ADD ]-----------------------------------
#
//Pictures: hack by DENZO
$query = "SELECT pic_username FROM " . ALBUM_TABLE . " WHERE pic_username='".$profiledata['username']."'";
$query_result = @$db->sql_query($query);
$pictures = 0;
$pictures = $db->sql_numrows($query_result)
$pics = '<span class="gen">Total pictures: </span></td>
<td><b><span class="gen">'.$pictures.'</b></td>
</tr>
<td align="right" nowrap="nowrap"><span class="gen">';
$lang['Location'] = $pics.$lang['Location'];
//Pictures: hack by DENZO
#
#-----[ SAVE/CLOSE ALL FILES AND ENJOY ]----------------
#
# EoM
###############################################################################
修正說明: -by- 心靈捕手 http://61.70.203.175
執行時若有出現錯誤, 則建議做以下的修改:
-----[ FIND ]-----
$pictures = $db->sql_numrows($query_result)
-----[ REPLACE ]-----
$pictures = $db->sql_numrows($query_result);
###############################################################################