[2.0.6] Per-User Avatar/Sig Disable

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
15
44%
Very Good
9
26%
Good
3
9%
Fair
3
9%
Poor
4
12%
 
Total votes: 34

defender39
Registered User
Posts: 169
Joined: Wed Nov 26, 2003 9:22 am

Post by defender39 »

easy install...works 100%
reddem0n
Registered User
Posts: 94
Joined: Thu Nov 27, 2003 2:46 am

Post by reddem0n »

j t wrote: I successfully installed this, after taking into account the various issues which previous posters have mentioned. It should be noted that I installed this by hand.


Looking at the unzipped MOD script:

line 192
- changed $showsigatures to $showsignatures

lines 239,247,268,276
- cosmetic change. Added    to end of line to line up new buttons w/ existing ones.

lines 287 and 299
- needs to be run by hand?? In my templates, at least, I believe it should have been an INLINE FIND, because the text to modify was on a long line of more-or-less html.
- Personally, I found it easiest to "prettify" the template text so I could actually read what was going on in those table-cells.


Made change to display_avatar_gallery() function, listed by Jorram

Code: Select all

in usercp_avatar.php find the display_avatar_gallery definition. you should seek for something beginning with: 

function display_avatar_gallery($mode, 

and then after the $allowsmilies, add 

$showavatars, $showsignatures, 
Failure to do this appears to mess up the date-format field at least some of the time. Before I made this correction, one user ended up with a date-format of "english" -- most of those letters actually mean something, interestingly enough. :)


Because we have some significant disagreement on the use of avatars, I changed the database default values to be show-avatars "no", and show-signatures "yes" -- this shouldn't make any difference to the rest of the MOD, of course.


It was interesting when I accidentally surrounded the {POST_MESSAGE} with the signature check, instead of the {POST_SIGNATURE} token. When I turned signature-view off, all I saw was the signature -- no message body was there! :D


A repackaged version of the MOD would be nice to see. I think it's very useful.

-- jt --


I don't understand though, I've done almost everything you said and it still doesn't work for me. I see the show signature/avator option in my profile and when I disable and update my profile. It says profile updated. When I go back to see the posts the avator/signatures are still there. Is there something I'm missing? Here's my forum address:
http://www.red-demon.com/forum/
Username: Test
Password: 123456
j t
Registered User
Posts: 17
Joined: Thu Jan 29, 2004 2:42 am
Contact:

Post by j t »

Potentially dumb question -- did you change the "DustyGreen" template you use, or did only change the subSilver template?

Any time you have additional or different templates, you have to make the corresponding change(s) to the "template/yourTemplate/eachFileName.tpl" files. And depening on what you've customized, remember that the lines might be different. Look for, and be cognizant of, what needs to be changed, instead of blindly changing the line after a FIND pattern.

[/i]
reddem0n
Registered User
Posts: 94
Joined: Thu Nov 27, 2003 2:46 am

Post by reddem0n »

yeah i guess i am pretty dumb....

Yes I did change the DustyGreen template I have since thats the only one I'm using. I also edited the tpl files in there that needed to be for the mod and from what I've been reading over the last few posts here.....but the mod doesn't do what its suppose to do..
j t
Registered User
Posts: 17
Joined: Thu Jan 29, 2004 2:42 am
Contact:

Post by j t »

reddem0n wrote: yeah i guess i am pretty dumb....



Nah... the question was potentially dumb. :)

I suspect that the problem is w/ your template file(s) though. I went to your forum, and I agree that the test user's show_avatar flag is off, but he still sees the avatars.

Could you post a portion of your viewtopic_body.tpl file here?

Starting at the comment-line that says "BEGIN postrow" (in my template, it's line 36), post down through the comment-line that says "END postrow" -- about 50-60 lines, probably.

-- jt --
dbcmaster
Registered User
Posts: 14
Joined: Tue Dec 30, 2003 2:24 am
Location: Mass
Contact:

Post by dbcmaster »

I wish that they would just pull the broken one, fix the code, and then reissue it.
User avatar
abdulsbar
Registered User
Posts: 181
Joined: Wed Mar 12, 2003 9:50 pm

Post by abdulsbar »

Just put this in and it works a little too well for my liking. It has completely taken off avatars. I have it set to show avatars but there is no longer an option in the Profile section nor the User Managment section on the ACP. Any ideas on what I have done wrong?
j t
Registered User
Posts: 17
Joined: Thu Jan 29, 2004 2:42 am
Contact:

Post by j t »

To me, that sounds suspiciously like you're missing a close-comment HTML "tag' "-->" or missed a greater-than closure of some html tag (e.g. doing something like <br text and code that won't show up<br>) -- note the missing closure of the initial line-break.

Of course, I might be completely off base here. YMMV and all that.
User avatar
abdulsbar
Registered User
Posts: 181
Joined: Wed Mar 12, 2003 9:50 pm

Post by abdulsbar »

Just gone through the instructions again and done it completely to script and still getting the same. Can't even view posts now :?

Code: Select all

Parse error: parse error, unexpected T_IF in /usr/local/psa/home/vhosts/domain.co.uk/httpdocs/forum/viewtopic.php on line 1203
reddem0n
Registered User
Posts: 94
Joined: Thu Nov 27, 2003 2:46 am

Post by reddem0n »

j t wrote:
reddem0n wrote:yeah i guess i am pretty dumb....



Nah... the question was potentially dumb. :)

I suspect that the problem is w/ your template file(s) though. I went to your forum, and I agree that the test user's show_avatar flag is off, but he still sees the avatars.

Could you post a portion of your viewtopic_body.tpl file here?

Starting at the comment-line that says "BEGIN postrow" (in my template, it's line 36), post down through the comment-line that says "END postrow" -- about 50-60 lines, probably.

-- jt --



Code: Select all

<!-- BEGIN postrow -->
	<tr> 
		<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.MINIPROFILE}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}<br />{postrow.CASH}<br /><a href="{postrow.ITEMSNAME}">Items</a>{postrow.ITEMS}</span><br /></td>
		<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen"> </span>   {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
				<td valign="top" nowrap>{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
			</tr>
			<tr> 
				<td colspan="2"><hr /></td>
			</tr>
			<tr>
				<td colspan="2"><span class="postbody">{postrow.MESSAGE}</span>{postrow.ATTACHMENTS}<span class="postbody">{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
			</tr>
		</table></td>
	</tr>
	<tr> 
		<td class="{postrow.ROW_CLASS}" width="150" align="left" valign="middle"><span class="nav"><a href="#top" class="nav">{L_BACK_TO_TOP}</a></span></td>
		<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="bottom" nowrap><table cellspacing="0" cellpadding="0" border="0" height="18" width="18">
			<tr> 
				<td valign="middle" nowrap>{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}<script language="JavaScript" type="text/javascript"><!-- 

	if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 )
		document.write(' {postrow.ICQ_IMG}');
	else
		document.write('</td><td>&nbsp;</td><td valign="top" nowrap="nowrap"><div style="position:relative"><div style="position:absolute">{postrow.ICQ_IMG}</div><div style="position:absolute;left:3px;top:-1px">{postrow.ICQ_STATUS_IMG}</div></div>');
				
				//--></script><noscript>{postrow.ICQ_IMG}</noscript></td>
			</tr>
		</table></td>
	</tr>
	<tr> 
		<td class="spaceRow" colspan="2" height="1"><img src="templates/DustyGreen/images/spacer.gif" alt="" width="1" height="1" /></td>
	</tr>
	<!-- END postrow -->
j t
Registered User
Posts: 17
Joined: Thu Jan 29, 2004 2:42 am
Contact:

Post by j t »

Thanks.

If you look at the instructions, the second-to-last file it has you edit is the one you excerpted -- templates/yourTemplate/viewtopic_body.tpl

That has two edits to make -- replace the "{postrow.POSTER_AVATAR}" token w/ a block based on switch_showavatars, and an equivalent replacement of the "{postrow.SIGNATURE}" token. I've highlighted those tokens in your code. (I had to remove it from the "code" UBB tags, because they were preventing the highlighting from being interpreted. Sigh.)

  • <!-- BEGIN postrow -->
    <tr>
    <td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.MINIPROFILE}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}
    {postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}<br />{postrow.CASH}<br /><a href="{postrow.ITEMSNAME}">Items</a>{postrow.ITEMS}</span><br /></td>
    <td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
    <td valign="top" nowrap>{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
    </tr>
    <tr>
    <td colspan="2"><hr /></td>
    </tr>
    <tr>
    <td colspan="2"><span class="postbody">{postrow.MESSAGE}</span>{postrow.ATTACHMENTS}<span class="postbody">
    {postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
    </tr>
    </table></td>
    </tr>
    ...



As you can see, those tokens have not been surrounded by the BEGIN//END switch_showavatar and switch_showsignatures, so they are always displayed -- just like you're seeing.

You need to replace those lines (and personally, I find it easier to read if you also put in some extra carriage-returns to format the template for easier reading) like the instructions said:

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
#
templates/subSilver/viewtopic_body.tpl
# 
#-----[ FIND ]------------------------------------------ 
#
{postrow.POSTER_AVATAR}
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#

<!-- BEGIN switch_showavatars --> 
<br />{postrow.POSTER_AVATAR} 
<!-- END switch_showavatars -->

# 
#-----[ FIND ]------------------------------------------ 
#
{postrow.SIGNATURE}
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#

<!-- BEGIN switch_showsignatures --> 
{postrow.SIGNATURE} 
<!-- END switch_showsignatures -->

That means that, after replacment (and after making the code more readable by inserting linefeeds and white-space), you have this:

Code: Select all

<!-- BEGIN postrow --> 
   <tr> 
      <td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}">
         <span class="name">
            <a name="{postrow.U_POST_ID}"></a>
            <b>{postrow.MINIPROFILE}</b>
         </span><br />
         <span class="postdetails">
            {postrow.POSTER_RANK}<br />
            {postrow.RANK_IMAGE}
            <!-- BEGIN switch_showavatars -->
               {postrow.POSTER_AVATAR}<br />
            <!-- END switch_showavatars -->
            <br />{postrow.POSTER_JOINED}<br />
            {postrow.POSTER_POSTS}<br />
            {postrow.POSTER_FROM}<br />
            {postrow.CASH}<br />
            <a href="{postrow.ITEMSNAME}">Items</a>
            {postrow.ITEMS}
         </span>
         <br />
      </td>
      ...
...with a similar replacement being made to the postrow.SHOW_SIGNATURE token.

Does that make sense?
User avatar
abdulsbar
Registered User
Posts: 181
Joined: Wed Mar 12, 2003 9:50 pm

Post by abdulsbar »

Think i've solved the missing avatar settings, in the Config settings on the ACP all the avatar options were set to no/off
User avatar
Tryp
Registered User
Posts: 16
Joined: Tue Apr 22, 2003 10:16 pm
Location: The Moongate
Contact:

Post by Tryp »

Winterboy wrote: I tried again as you suggested and everything seems to work now. :) It took me an hour to figure out that these lines:

<!-- BEGIN switch_showsignatures -->
{postrow.SIGNATURE}
<!-- END switch_showsignatures -->

should really be placed under each other in viewtopic_body.tpl. Stupid mistake... :roll:


I am so glad someone pointed that out because I installed this MOD, which worked great, but it caused everything under my users avatars (post count, location, etc) to disappear!

After seeing this, I went into viewtopic_body.tpl, inserted 4 carriage returns, which placed the above code exactly as you see it above, and all my users info came back! :D

Great MOD, my users thank you :)
Time is a conspiracy invented by the Swiss to sell more watches.
reddem0n
Registered User
Posts: 94
Joined: Thu Nov 27, 2003 2:46 am

Post by reddem0n »

ok so this finally works and all that but for some reason most of my users profile is set to No by default. How can I change this?
reddem0n
Registered User
Posts: 94
Joined: Thu Nov 27, 2003 2:46 am

Post by reddem0n »

*bump
Post Reply

Return to “[2.0.x] MOD Database Cleanup”