|
|
Joined: Feb 2002
Posts: 295
Member
|
Member
Joined: Feb 2002
Posts: 295 |
Hi, I found this hack at Photopostdev.com and think it will be perfect for my site (it allows all members to see their own photos, but only paying members to see all photos). Problem is that part of it is missing, the part that does the checking of access. Could someone here figure this out, or at least point me in the right direction? Code of the hack is: <br />(1) At the end of function get_imagethumb in pp-inc:<br /><br /> // begin hack<br /> if ( ! permitted("PM", $theuser) )<br /> $imgtag="<A HREF=/pay/payMain.php><br /> <IMG SRC=../images/emptyFrame.jpg border=0 height=100 width=100 alt=\"Why is this frame empty?\"><br /> </A>";<br /> // end hack<br /> return( $imgtag );<br />}<br /><br />(2) Approx line 380 of showphoto, after $imgdisp has been assigned (no more found in text search):<br /><br /> // begin hack<br /> if ( ! permitted("PM", $iuserid) )<br /> {<br /> $imgdisp="<table border=\"2\" width=\"$width\" height=\"$height\" bordercolor=\"#996633\" bordercolorlight=\"#996633\" bordercolordark=\"#996633\"><br /> <tr><td width=\"100%\"> </tr></table>";<br /> }<br /> // end hack<br /><br />(3) In pp-inc, after $User=array();<br /><br /> You would need to write your own function here... depends on how you determine<br /> who is currently logged in and what thier permissions are. Key is to always permit<br /> accesss when id or name matches current login. Otherwise, only for paid members.<br /><br /> // begin hack<br /> function permitted($op, $targetId=0, $targetName="") {<br /> global $memberPermit, $memberId, $memberName;<br /> if ( ($memberId<>0) && ($memberId==$targetId) ) return true;<br /> if ( ($memberName<>"Guest") && ($memberName!="") && strtolower($memberName)==strtolower($targetName) ) return true;<br /> for ($i=0;$i<strlen($op);$i++) {<br /> $c=substr($op,$i,1);<br /> if (is_integer(strpos($memberPermit,$c))) return true;<br /> }<br /> // Allow member to see/do his own stuff return false;<br /> }<br /> // end hack<br /> Sanuk!
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
What does this mod do? Did you already get an answer at photopostdev?
|
|
|
|
Joined: Feb 2002
Posts: 295
Member
|
Member
Joined: Feb 2002
Posts: 295 |
Hi, "What does this mod do?" The hack allows everybody to see the pictures they uploaded themselves, but only those people in a specific usergroup (for instance paying members) to see all pictures. "Did you already get an answer at photopostdev?" Must admit I did not post there as I figured this would be more UBBT related than PhotoPost. The post in question was more than 6 months old as well. Did have a bit of play with it myself, but could not get it working. Sanuk!
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|