forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Bridging/Integration => Topic started by: garrynz on March 24, 2005, 07:29:38 pm
-
Hi, I have seen a few requests and such on how to add latest uploaded file and comments onto the phpbb userprofile. What you can do is do a cowboy job like I have done. First install phpbb eXtreme Styles mod, this alows you to include files on the phpbb templates. Then copy coppermine profile.php file and give it a different name. Comment out stuff like pageheader($title); , endtable(); , pagefooter(); and trial and error on other stuff to comment out. The 3rd and 4th message on this thread is how to get quotas and a percentage table without installing xtreme style mod.
Add in includes/usercp_viewprofile.php below $template->assign_vars(array(
'USERID' => $profiledata['user_id'],
then add this to profile_view_body.tpl
<!-- PHP -->
include('http://127.0.0.1/gallery/include-profile.php?uid=' . $this->vars['USERID']);
<!-- ENDPHP -->
obviously changing it to your host and renamed profile.php page.
I am working on getting upload statistics also added, as I know absolutely no php I am relying on internet tutorials to figure it out. So far I have added this to my include-profile.php page just above $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['thumb_width']);
$sql = 'SELECT SUM(total_filesize) AS sum_total_filesize FROM cpg132_pictures WHERE owner_id =' . $uid;
$result = mysql_query($sql) or die(mysql_error());
$i = mysql_fetch_array($result);
$uploaded = round($i['sum_total_filesize'] / 1024);
and added $uploaded somewhere amounst $user_thumb = .......
Will post back when/if I figure out how to get quota allowed for a group and make a nice graph thingy :) or someone else may like to chip in.
-
Well figured out how to get percentages and make a bar graph. I am sure there is a better way, but since I am new to mysql/php ... someone with more php brains may like to figure out and post how to make one mysql query instead of three.
The select from users below should have your phpbb extention i.e phpbb_users and both phpbb and coppermine need to be on the same database.
$sql = 'SELECT SUM(total_filesize) AS sum_total_filesize FROM cpg132_pictures WHERE owner_id =' . $uid;
$result = mysql_query($sql) or die(mysql_error());
$i = mysql_fetch_array($result);
$uploaded = round($i['sum_total_filesize'] / 1024);
$sql = 'SELECT user_level FROM users WHERE user_id =' . $uid;
$result = mysql_query($sql) or die(mysql_error());
$i = mysql_fetch_array($result);
$level = $i['user_level'];
if ($level == 0)
{$level = "2";}
if ($level == 1)
{$level = "1";}
// add more if custom users
$sql ='SELECT group_quota FROM cpg132_usergroups WHERE group_id =' . $level;
$result = mysql_query($sql) or die(mysql_error());
$i = mysql_fetch_array($result);
$group_quota = $i['group_quota'];
$percentage = round(($uploaded / $group_quota) * 100) ;
// remaining used for 2nd td length in table
$remaining = (100 - $percentage);
and for the table, make a 1x1 pixle image the colour of your choice.
<table width=\"100\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"graphtable\"><tr><td width=\"" . $percentage . "\" background=\"/images/uploadgraph.gif\" height=\"5\"> </td><td class=\"endgraph\" width=\"". $remaining . "\"></td></tr></table>
I will have a crack at adding this code to phpbb's profile page.
-
Well its fairly simple to get quota and uploaded data from phpbb files. Once again you need to have phpbb and coppermine on the same database. Also change select user_level FROM users to whatever your phpbb tables are names i.e select user_level FROM phpbb_users
Open phpbb/includes/usercp_viewprofile.php
add above $template->assign_vars(array(
// get gallery quotas/uploaded
$sql = 'SELECT SUM(total_filesize) AS sum_total_filesize FROM cpg132_pictures WHERE owner_id =' . $profiledata['user_id'];
$result = mysql_query($sql) or die(mysql_error());
$i = mysql_fetch_array($result);
$uploaded = round($i['sum_total_filesize'] / 1024);
$sql = 'SELECT user_level FROM users WHERE user_id =' . $profiledata['user_id'];
$result = mysql_query($sql) or die(mysql_error());
$i = mysql_fetch_array($result);
$level = $i['user_level'];
if ($level == 0)
{$level = "2";}
if ($level == 1)
{$level = "1";}
$sql ='SELECT group_quota FROM cpg132_usergroups WHERE group_id =' . $level;
$result = mysql_query($sql) or die(mysql_error());
$i = mysql_fetch_array($result);
$group_quota = $i['group_quota'];
$percentage = round(($uploaded / $group_quota) * 100) ;
$remaining = (100 - $percentage);
// end get gallery quotas/uploaded
add below 'YIM' => $yim, or anywhere in there
'UPLOADED' => $uploaded,
'GROUPQUOTA' => $group_quota,
'PERCENTAGE' => $percentage,
Then add {UPLOADED} {GROUPQUOTA} ..... to profile_view_body.tpl
-
here is a graph to add in includes/usercp_viewprofile.php add below $remaining = (100 - $percentage); in the above code
$percenttable = "<center>Quota Used<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"50%\" align=\"right\">0% </td><td><table width=\"100\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"" . $percentage . "\" background=\"/images/uploadgraph.gif\" height=\"5\"> </td><td width=\"". $remaining . "\"></td></tr></table></td><td width=\"50%\" align=\"left\">100%</td></tr></table></center>";
and add below $template->assign_vars(array(
'PERCENTGRAPH' => $percenttable,
then {PERCENTGRAPH} in profile_view_body.tpl
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2F207.58.164.217%2Fprofile.gif&hash=3503e05312d88a6b6dcb93142651bf5fe3bb7d55)
-
Very nice. :)
-
How is this going to work on the Profile Control Panel MOD? which files to edit?
-
Hi gaatsen, I will give it a crack over the next few days as I have just installed profile control panel.
-
hy garrynz,
maybe you can help me. I need only the quata (disk usage) part of your script and hopefully without having xtreme style mod, dont like it :-\\
Thanks
-
Hi, my 3rd and 4th messages on this tread are for getting the quota without having the xtreme style mod installed.
-
gaatsen so far I can only figure it out using the include way with xtreme style mod. If you want to do it this way open profilecp/def/def_userfuncs_std.php add below $template->assign_vars(array(
'USERID' => $view_userdata['user_id'],
Open templates/Subsilver/profilcp/public_base_body.tpl and add at the bottom
<!-- PHP -->
include('http://127.0.0.1/gallery/include-profile.php?uid=' . $this->vars['USERID']);
<!-- ENDPHP -->
-
Thanks Garrynz,
quota system now works well.
Next idea is, how to get phpbb users viewprofile part to the coppermine´s profile, like a link. Cant make those sql queries, any idea how to do it, Garrynz ?
::)
-
I am not sure what you mean, when I click on "my profile" in coppermine it takes me to my phpbb profile, this is part of bridging the two together. So in effect the only way I can view my coppermine profile is to manually add the address in the address bar.
-
Oh you mean so you can view their latest uploaded and comments? If so just add this somewhere in your profile_view_body.tpl template file <a href="/gallery/profile.php?uid={USERID}">Gallery profile</a>
And add in includes/usercp_viewprofile.php below $template->assign_vars(array(
'USERID' => $profiledata['user_id'],
That should do it. Off course if you didnt want to use xtreme style mod you could use a iframe to include it.
-
:D
allmost, but i want to be it reversed. I use coppermine profile page as well, and there must be a link to phpbb profile.
Any idea ?
-
One way you could do it. Open gallery/profile.php find
$form_data = array('username' => $user_data['user_name'],
replace with
form_data = array('username' => '<a href="/phpbb/profile.php?mode=viewprofile&u=' . $HTTP_GET_VARS['uid'] . '">' . $user_data['user_name'] . '</a>',
-
Thanks a lot,
you´re my life saver. ;)
-
Garrynz,
have you got any idea for example how to get phpbb privatemessage notification line ("you have 1 unread messages") to coppermine photogallery main page, just below the topmenu (it´s in theme.php). The user must be logged in, like in phpbb, to see this line (notification). I have already made a link to gallery, which points to forum/privmsg.php?folder=inbox. But when users are looking pictures in gallery, they don´t know when a privatemessage arrives, there´s no note for that.
Could you help to figure this out ?
???
-
I was wondering, if the quota information could be inserted into the phpbb/profile.php?mode=editprofile page as well ? Then users do not have to find their viewprofile part form the memberlist to check the quota. :-\\
-
One way you could do it. Open gallery/profile.php find
$form_data = array('username' => $user_data['user_name'],
replace with
form_data = array('username' => '<a href="/phpbb/profile.php?mode=viewprofile&u=' . $HTTP_GET_VARS['uid'] . '">' . $user_data['user_name'] . '</a>',
note: don't forget the $ in $form_data or you will get a parse error 8)
thanks
-
Ik would like to have this mod on the profile cp mod. The pix must appear where the anyoing map appears. In the public view of the profile. How to do that?
-
@gaatsen & matu111: usually, mods come as-is, there's little point in permanently requesting new features. The mod author might not even be around any more.
-
How can work SIMPLE MACHINES FORUM ?
-
ask this on the smf board - you would have to write a completely different hack. Don't try to hijack threads, especially when the previous postings already say something along the same lines.
-
I know this is a very old topic, but could someone include their modified profile.php so I can get some ideas of what all needs to be removed?
-
I go the profile page to show the link, but Im trying to get php to show the link When veiwing posts.
see over there on the left, I want it to display "MY GALLERY" under where it sayd POST COUNT...
I have successfully gotten the link to show by adding the
<a href="/gallery/profile.php?uid={USERID}">Gallery profile</a>
but the link stops at the uid, without adding the persons UID....
ex: /gallery/profile.php?uid=
Im not sure where else I need to edit.
I added
below $template->assign_vars(array(
'USERID' => $profiledata['user_id'],
to the topic_review.php but that didnt help...
any ideas?
-
@ somebunny
I think, I can help, but I dont understand where exactly you want to show the link "Gallery Profile" - in view topic, in profile page or in diffrent place.
-
When reading all the posts in a thread. Like right now, if you look over to the left to see who wrote this, you will see my username, karma, and all that. I would like it to work right there under karma...
-
Open viewtopic.php
Find:
'U_POST_ID' => $postrow[$i]['post_id'])
Before ADD
'U_USER_ID' => $posterow[$i]['user_id'],
To make a link for the gallery in viewtopic_body.tpl add this:
<a href="/gallery/profile.php?uid={postrow.U_USER_ID}">Gallery profile</a>
-
nope, still doesnt show the userid.
I dont understand why it works on the PROFILE page, but not right there.
[Edit GauGau] Replaced hotlinkied image with attachment [/Edit]
Code is inserted correctly...
'L_GALLERY_LINK' => $gallerylink,
'U_USER_ID' => $posterow[$i]['user_id'],
'U_POST_ID' => $postrow[$i]['post_id'])
);
-
I made a little mistake, sorry. Here, that should work:
In viewtopic.php change:
'U_USER_ID' => $posterow[$i]['user_id'],
to
'U_USER_ID' => $poster_id,
-
oh yay!
thats seems to have it!
THANKS SO MUCH!!!!
;D
-
I've installed this hack onto my forum, but I'm getting error code, here's a link to the example:
http://cordiafreaks.com/phpbb2/profile.php?mode=viewprofile&u=2 (http://cordiafreaks.com/phpbb2/profile.php?mode=viewprofile&u=2)
I hope someone can help! thanks
-
Here's my edited 'profile_view_body.tpl'..... It isn't inserting the users id into the hyperlink!
<a href="/cpg1410/profile.php?uid={postrow.U_USER_ID}">Gallery profile</a>
<!-- PHP -->
include('/cpg1410/include-profile.php?uid=' . $this->vars['USERID']);
<!-- ENDPHP -->
And the 'usercp_viewprofile.php'
$template->assign_vars(array(
'USERID' => $profiledata['user_id'],
'USERNAME' => $profiledata['username'],
I have copied the 'profile.php' and renamed the copy to 'include-profile.php' but haven't made any changes to the file.
In my php profiles, I want a link to the user's gallery with the latest addition thumbnails below it.
Cheers
-
I worked out some of it myself... no longer need the help! Thanks
-
Why don't you share your insight, for the benefit of others with similar questions?
-
Hi,
is there any MOD which could help do the same if i am not using cpg in bridging mode?
thnx..
-
I have just got this to work.
PHPBB3 - COPPERMINE bridge, this one http://forum.coppermine-gallery.net/index.php/topic,53678.0.html
Coppermine installed in web root and phpbb3 in /forum
using Subsilver2 style
Display a link to all of a users uploaded images in the phpbb3 user profile.
Find in memberlist.php
'U_REMOVE_FOE' => ($foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&mode=foes&usernames[]=' . $user_id) : '',
Add after
'CPG_GAL_LINK' => $user_id != ANONYMOUS ? ('../thumbnails.php?album=lastupby&uid=' . ($user_id)) : '',
Find in styles/subsilver2/template/memberlist_view.html
<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
<tr>
<td class="genmed" align="center">[ <!-- IF U_ADD_FRIEND and U_ADD_FOE--><a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a> | <a href="{U_ADD_FOE}">{L_ADD_FOE}</a><!-- ENDIF --><!-- IF U_REMOVE_FRIEND --><a href="{U_REMOVE_FRIEND}">{L_REMOVE_FRIEND}</a><!-- ENDIF --><!-- IF U_REMOVE_FOE --><a href="{U_REMOVE_FOE}">{L_REMOVE_FOE}</a><!-- ENDIF --> ]</td>
</tr>
Add After
<tr>
<td class="genmed" align="center">[<a href="{CPG_GAL_LINK}">View all uploaded images</a>]</td>
</tr>
-
An unrelated reply by sjoudi (http://forum.coppermine-gallery.net/index.php?action=profile;u=63334) was split into a separate thread (http://forum.coppermine-gallery.net/index.php/topic,57901.0.html) and moved to the bridging support board (http://forum.coppermine-gallery.net/index.php/board,50.0.html), where sjoudi should have started his thread in the first place. Of course you can not start a new thread on the mods board, as that board deals with actual mods and is not meant to allow people to dump their support or mod requests. That's what the support board is for. Hence I moved your reply. You caused a lot of extra moderation effort that could have been avoided easily if you would have looked just a little harder.