Previous Thread
Next Thread
Print Thread
Rate Thread
#282998 01/08/2005 10:53 PM
Joined: Feb 2002
Posts: 295
Member
Member
Offline
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:
Code
<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%\">&nbsp</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!

Sponsored Links
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?


- Allen wavey
- What Drives You?
Joined: Feb 2002
Posts: 295
Member
Member
Offline
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!


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)