[BETA] ADD_ON to Profile in Photo MOD

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
discipleao
Registered User
Posts: 63
Joined: Thu Jan 02, 2003 4:58 am

[BETA] ADD_ON to Profile in Photo MOD

Post by discipleao »

This MOD came about in the last couple of days after I installed AdydBurns Photo In Profile MOD. You can see the beginnings of the idea here:
http://www.opentools.de/board/viewtopic.php?p=7012#7012
and it was first shown completed here:
http://www.phpbb.com/phpBB/viewtopic.php?t=68467

Basically what is: I wanted to be able to show an icon in Memberlist IF a user had a photo in their profile, so I could see at a glance who had one and who didn't.
While searching for info on this I found zleviticus who had modded his own board with something similiar.
So working together we combined the two - and here's what you get:

First: A text link in viewtopic IF the poster
has a photo in their profile, so you can SEE who's posting:
Image

Second: An icon (in this case a little 'camera')
in Memberlist, so you can see who has a photo in their profile:
Image

Here's the file (includes icon):
ADDON _Photo in Profile MOD
***Note: The Photo in Profile MOD MUST be installed FIRST for this to work. You can get it at http://www.opentools.de/board/

I'd like someone else look at this, especially the memberlist portion because there is some tweaking of the tables needed, and I want to see if my instructions can be followed. I used Dreamweaver to help add the column to the table and to resize them as needed.
crazyd1415
Registered User
Posts: 63
Joined: Mon May 13, 2002 3:41 am

Post by crazyd1415 »

part 2 doesnt work. It doesnt show the profile photo link thing in the posts. I followed all the steps, some of your line numbers were off a big I'm guessing from other mods you have. I dont get any error messages. Just the profile photo link won't show up.
discipleao
Registered User
Posts: 63
Joined: Thu Jan 02, 2003 4:58 am

Post by discipleao »

Well, it does work cause I have it on my site, give me a minute to look at the instructions - maybe a typo...

How about part 1??
crazyd1415
Registered User
Posts: 63
Joined: Mon May 13, 2002 3:41 am

Post by crazyd1415 »

part one, the part in the memberlist works fine. just the part in view topic doesnt work. I checked over and over again to make sure i did everything right. even restored a backup file and redid everything from scratch but nothing shows up.
discipleao
Registered User
Posts: 63
Joined: Thu Jan 02, 2003 4:58 am

Post by discipleao »

Now that the site is back up....

Yep it looks like I left something out...when I got the code from Z. it didn't work for me either...I played with it, got it to work, and then posted his instructions without adding my changes...

So here ya go:

Code: Select all

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

        viewtopic.php

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

$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile,u.user_allow_viewonline, u.user_session_time, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
        WHERE p.topic_id = $topic_id

# 
#-----[ FIND, INLINE ]------------------------------------------ 
#

 u.user_from,

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

 u.user_photo,
I've added this to the zip as well...

Let me know!!! I just pulled this from my own viewtopic.php, not from memory, so it works...
discipleao
Registered User
Posts: 63
Joined: Thu Jan 02, 2003 4:58 am

Post by discipleao »

crazyd1415 wrote: some of your line numbers were off a big I'm guessing from other mods you have.
- I didn't totally write part 2, I did part 1...but the line numbers are a ballpark thing, I don't think anyone's will be the same...Z. put them in and I left them...

If you can, when you get it done post little pics like I did on my site in this thread:
http://www.hisdisciple.net/viewtopic.php?t=41
Thanks
crazyd1415
Registered User
Posts: 63
Joined: Mon May 13, 2002 3:41 am

Post by crazyd1415 »

thanks, it works now, I couldnt locate the new part you added by using the find function in my text editor. I dont know why so I had to find it by eyeing it but here is a lil correction to help people find the code easier.

Code: Select all

# 
#-----[ FIND around line 383]------------------------------------------ 
#
//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid
	FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
	WHERE p.topic_id = $topic_id
		$limit_posts_time
		AND pt.post_id = p.post_id
		AND u.user_id = p.poster_id
	ORDER BY p.post_time $post_time_order
	LIMIT $start, ".$board_config['posts_per_page'];

# 
#-----[ FIND, INLINE ]------------------------------------------ 
#

 u.user_from,

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

 u.user_photo,

# 
#-----[ FIND ]------------------------------------------ 
#
# around line 1200

        //
        // Again this will be handled by the templating
        // code at some point
        //
        $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
        $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
 
//Code for user photo
        if ($postrow[$i]['user_photo'] != '' ){
        $Has_Profile_Photo = '<a href="profile.php?mode=viewprofile&u=' . $poster_id.'">Profile Photo</a>';
        }else
        $Has_Profile_Photo = '';
//Code for user photo

# 
#-----[ FIND ]------------------------------------------ 
#
# around line 1238

                          'MSN_IMG' => $msn_img,
		'MSN' => $msn,
		'YIM_IMG' => $yim_img,
		'YIM' => $yim,
		'EDIT_IMG' => $edit_img,
		'EDIT' => $edit,

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

'Has_Profile_Photo'=> $Has_Profile_Photo,
I think for this code to be accepted they will make you change some of you syntax to match phpBB standard code. But everything works fine. They'll also prob make you put all txt from the tpl files into lang instead.
discipleao
Registered User
Posts: 63
Joined: Thu Jan 02, 2003 4:58 am

Post by discipleao »

I'm glad it works for you...and I know it needs cleaning up - this whole thing evolved in something like 12 hours (okay okay - 18 hrs)...

But as far as "getting it accepted", I don't know if I care one way or another, I just hope if people want it, they can get it .

So how do you like it now that you have it up & running??
crazyd1415
Registered User
Posts: 63
Joined: Mon May 13, 2002 3:41 am

Post by crazyd1415 »

i think it's a great add on. Helps with seeing who has a pic or not instead of clicking on the profile without knowing. Just wondering, i've asked this in another post but got no reply. Just wondering, do you take mod requests? Kind of like an addon even to this?
discipleao
Registered User
Posts: 63
Joined: Thu Jan 02, 2003 4:58 am

Post by discipleao »

What do you have in mind?
As you can tell I'm not a superman when it comes to code, but maybe I can help...if I can I will.
crazyd1415
Registered User
Posts: 63
Joined: Mon May 13, 2002 3:41 am

Post by crazyd1415 »

well, i wanted to display a random profile on my sites main page(not phpBB page) but only of members who had pics in their profile. And just to display their username and picture. Or maybe just display a random profile and if they had pics show the user name and pic and if they didnt have a pic have just the user name and say no pic available. I don't know how hard that is to do but I have no clue how to do that.
discipleao
Registered User
Posts: 63
Joined: Thu Jan 02, 2003 4:58 am

Post by discipleao »

I don't know how hard it is either :wink: , can't be to hard though - give me a day or so to look at it.

I guess the main questions are:
WHERE do you want to display this random profile?
WHAT do you want to see in it?
HOW OFTEN do you want it to change to another?
Every page load? Once a day?

Hmmm...maybe I'd even like to have this LOL

BTW I saw a similiar reuest on another board, have you asked for this before?

Oh wait - I just saw "not a php" page...that might take it out of my realm, but I'll still look at it & see if I think I can do it.
discipleao
Registered User
Posts: 63
Joined: Thu Jan 02, 2003 4:58 am

Post by discipleao »

Let me see your site.

Link?
crazyd1415
Registered User
Posts: 63
Joined: Mon May 13, 2002 3:41 am

Post by crazyd1415 »

i asked here in another post but no response, also asked acyd's board, no response. I made a futile attempt at it but i kept getting errors and i really dont know much php. The random profile goes on my site's main index page. I guess have it display a different profile on each refresh. For the profile info just the username would be fine and just the pix, and maybe location.
crazyd1415
Registered User
Posts: 63
Joined: Mon May 13, 2002 3:41 am

Post by crazyd1415 »

PM u my site url but dunno if it went through, phpBB site kinda slow for me right now. And wait, i want it on a php page. just not a phpBB page. i want it www.mysite.com/index.php
Locked

Return to “[2.0.x] MODs in Development”