Link-Solution to Gallery in VBulletin 3.x Link-Solution to Gallery in VBulletin 3.x
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Link-Solution to Gallery in VBulletin 3.x

Started by alfisti.net, August 07, 2004, 12:31:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alfisti.net

Ciao,

I don´t understand a lot from php and I give it up to wait for a good integration in PHP.
So I made a small, link solution. I know it is not perfect but it works :)
Should also run under Coppermine 1.3 if the tables and fields are the same (testet with VB 3.03 and Coppermine 1.2)


What does it do?
Add a gallery-link to postbit (display of user data in every posting of him) if the user has uploaded a picture to the gallery.
Example: http://www.alfa-forum.com/showthread.php?t=29404
On the right side, the links with the car.

Install this:

1.
Create a custom profil field: "radio button"
- Option No/Yes
- Set Default to: YES
- Field required: YES (I have an german version so I don´t know the exact words of the  adminCP)
- Field hided in profil: NO (IMPORTANT!!)
- Field searchable: NO
- Show on Memberlist: NO
- Allow user to input their own value: NO
- Which page display option: this is your choice!
Notice the field ID, this is important.

2.
Customize postbit-template
Add the following to a place you want to display the link:

<if condition="$post[field1] == 'Yes'"><div>
                                        <img src="link/to/your/icon.gif" border="0" alt="See Gallery pictures from $post[username] ">
                                        <a target="_blank" href="http://www.yourdomain.com/gallery/thumbnails.php?album=lastupby&uid=$post[userid]">See Pictures from $post[username]</a>
                                        </div></if>


IMPORTANT: change this "$post[field1]" to the field ID of your new custom field. Change the links to your URLs ;)

2a
To link personal albums add the following

<if condition="$post['catuserid'] = $post['userid'] + 10000"></if>

<if condition="$post[field2] == 'Yes'"><div>
                                        <img src="link to your/icon.gif" border="0" alt="Album of $post[username] ">
<a target="_blank" href="http://www.yourdomain.com/gallery/index.php?cat=$post[catuserid]">Album of $post[username] </a>
</div></if>

Thanks to Xeon of the german VB for the solution with the catuserID :)

3.
Edit the file forumlinks.php: Change field ID and prefix to your coppermine prefix
$DB_site->query('UPDATE userfield,COPPERMINEPREFIX_pictures SET userfield.field1 = "Yes" WHERE userfield.userid = COPPERMINEPREFIX_pictures.owner_id');

Save the file "forumlinks.php" into: includes\cron

4.
Create a new task in Admin CP (the third group from bottom in the left menu)
Name: Forumlinks
all other with "*" or what you prefer
Filename: ./includes/cron/forumlinks.php

thats all.
The cron will update the new custom-field to "Yes" if the user has uploaded a picture.
The postbit template show the link only if a picture exist.

I know this solution is not perfect but it works untill someone coded this is php.

André

alfisti.net

remove the ".txt" extension before upload to include\cron

Joachim Müller

Just to make this clear for newbies: this mod will not integrate coppermine with VBulletin - you will have to apply the bridge file stuff outlined in the documentation. Instead, this mod will make the integration even closer - there will be links inside your vbulletin board to coppermine.

GauGau

P.S. Moved to mods section

thaDRAGON

How do i do the same with IPB? i wanted to have something like

"<tr>
<td class="row3" valign='top'><b>Album</b></td>
<td align='left' class='row1'><a href='http://hookup.ph/cpg/index.php?cat={$info['mid']}'>View This User's Album</a></td>
  </tr>"

My problem is how do i put something like 10000 + {$info['mid']} ?

Joachim Müller

I recommend asking this on the IPB support board.

GauGau