HACK - Self-Register / Registered Comments Only all in one!
linton
Joined: 2002-10-12
Posts: 42 |
![]() |
Compilation Gallery Hack! Ok, this is a compilation of 2 other hacks that I DIDN'T WRITE! and a bit of my own work. Step 1) Step 2) "I was worried about idiots spamming my site with bogus comments, Change line 86 of util.php from: echo "<tr align=center><td colspan=3>$buf<br><br></td></tr>"; -------------------------------------------------------------------------------- to: // HACK - prevent non-users from leaving comments -------------------------------------------------------------------------------- MAKE SURE to back up the original file first!!!! have fun, Step 3) Open up add_comment.php Find Line #77 it should look like this <input type=hidden name="IPNumber" value="<?=$REMOTE_ADDR ?>"> Next Now replace it with this And that is it. If you have any problems leave a msg in this thread or e-mail me at me@linton.tk |
|
macsamurai
Joined: 2002-12-01
Posts: 16 |
![]() |
This simple self-register hack works great! It's exactly what I was loking for! Thanks for posting it! Now if only there was an easy, stadalone "last x pictures uploaded" or "view new pictures since last login". Everything I have found that's close, revolves around the last ALBUM, which isn't really relevant in my case, since I create master albums as categories and users upload indiv photos into those existing albums - or it requires *nuke or something similar, which i have no intention of switching to. At least I don't have to manually register everyone that emails me now though. Great time saver. I set permissions for all albums to have "logged in" users able to upload photos and it's all done without my having to worry about a thing. |
|
drazin
Joined: 2002-11-23
Posts: 144 |
![]() |
great job on putting that together linton. but i got some questions for you. how did you get that Please register before posting to show up in the inline.photo.footer when the user is not logged in and then how did you get it to not show up when the do log in?. also, i was wondering if there was a way to pre set permissions for the new users that self register. because when some one registers for your site they have access to add new albums and everything. i want to restrict access to only posting comments. know a way? |
|
linton
Joined: 2002-10-12
Posts: 42 |
![]() |
linton
Joined: 2002-10-12
Posts: 42 |
![]() |
OK, so this posting thing is not working right .. here is what you got to do. Find line 64 in utils.php ...it is the start to the viewComment functions. Right after the lines $url = "add_comment.php?set_albumName={$gallery->album->fields[name]}&index=$index"; add this $url1 = "user.php"; thanks should be all you need, about the change in premissions i am not sure .. but i will look into it. thanks |
|
drazin
Joined: 2002-11-23
Posts: 144 |
![]() |
ok i did that and it seemed to work but when i log in....i now have 2 add comment lines. not a super big deal but would you know how to get rid of one? |
|
linton
Joined: 2002-10-12
Posts: 42 |
![]() |
I do .... if you look in the code of the last post i have commented out the original link which is //echo "<tr align=center><td colspan=3>$buf<br><br></td></tr>"; that is all you have to do, you will now only get one add comment link. |
|
drazin
Joined: 2002-11-23
Posts: 144 |
![]() |
i dont get it. what do i have to do? |
|
dtdgoomba
Joined: 2002-11-04
Posts: 185 |
![]() |
In case you're not familiar with PHP coding, putting // in front of a line of code, keeps it from being run, so in that case if you knew this, then maybe you're asking something different. does this help? |
|
drazin
Joined: 2002-11-23
Posts: 144 |
![]() |
no i understand that... i just dont understand which line i have to comment out. did you edit the post to make it right? id ont see what to change edit: ok i got it. heres what i did. right after the hack code you supplied theres i just added that // before the echo and when i log in, the add comment feature is there only once. its good. thanks alot! |
|
dtdgoomba
Joined: 2002-11-04
Posts: 185 |
![]() |
ok :smile: sorry, i thought you might know what a // was Isn't the line linton is referring to just above //HACK? |
|
drazin
Joined: 2002-11-23
Posts: 144 |
![]() |
hey linton or whoever... when users try to leave comments now.. no user name appears when they submit it. it only shows the email addy. any ideas on how to fix it? |
|