Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Template design and Front-End Code

Post Reply
 
Thread Tools
  #1  
Old 09-11-2006, 08:20 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
GeoS No SPAM template

Hi all dear Pixelpost users,

Today, after few weeks of prepering to do it, you can download and test my antispam template.
This is made for current Pixelpost version (1.5 final).

As this is in development stage then please make backup of your /index.php file (if you hack it).

Here is the link:
ZIP -
http://piotrgalas.com/projects/geos_...ate_PPv1.6.zip

PS This is adapted for use simple template.

Installation:

1) Be sure you are using Pixelpost 1.5 final. Whole hack is made only for this version of Pixelpost.

2) Download file linked above.

3) Unpack it into your local pixelpost directory. So index.php should replace previous one in directory and there should be new file called comment.php. There should be also new dir within Pixelpost's template dir called geos-nospam.

4) If you want you can use this tamplate and customize it or take this code:
HTML Code:
<div id="comments">
  	<a name="comments"></a>
  	<script language='javascript' type='text/javascript'>flip('comments',0);</script>
  	<IMAGE_COMMENTS>
  	<ul id="new_comments"><li>&nbsp;</li></ul>
  	<div class="border_left" id="comment_form">
  		<img src="thumbnails/thumb_<IMAGE_NAME>" alt="<IMAGE_TITLE>" title="<IMAGE_TITLE>" style="float:right" />
  		<b>ADD COMMENT</b><br /><br />
  		Message:<br />
  		<textarea name='message' id='message' rows='4' cols='45' class='input2'></textarea><br /><br />
  		Name:<br />
  		<input type='text' name='name' id='name' class='input2' value='<VINFO_NAME>' /><br /><br />
  		Website URL, if any: <br />
  		<input type='text' name='url' id='url' class='input2' value='<VINFO_URL>' /><br /><br />
  		Email: <br />
  		<input type='text' name='email' id='email' class='input2' value='<VINFO_EMAIL>' /><br /><br />
  		<input type='checkbox' name='vcookie' id='vcookie' value='set' checked="checked" /> Save User Info<br /><br />
  		<input type='hidden' name='parent_id' id='parent_id' value='<IMAGE_ID>' />
  		<input type='hidden' name='parent_name' id='parent_name' value='<IMAGE_NAME>' />
  		<button class='input3' onclick='save_comment();'>Add</button>
  	</div>
  	<div id="add_state"></div>
</div>
and put it to own image_template.html file.

Remember also to copy to own template and include paths to two additional JS libraries (and then change path to correct one):
HTML Code:
<script type="text/javascript" src="templates/geos-nospam/scripts/advajax.js"></script>
<script type="text/javascript" src="templates/geos-nospam/scripts/lib.php"></script>
6) You can open templates/geos-nospam/scripts/lib.php and add something to value of $key variable (but by default it should be enough mixed thanks to variable $_SERVER['DOCUMENT_ROOT'] to be safe for use against SPAM BOTs).

7) More or less it should be all. Code isnt perfect yet but this is some good base to solve SPAM issue. As Ive made few more tweaks from time of publishing this then maybe in near future there will be small tweak.
__________________
photoblog | portfolio | addons | Donate

Last edited by GeoS; 08-06-2007 at 06:48 PM.
Reply With Quote
  #2  
Old 09-15-2006, 05:36 PM
Connie
Guest
 
Posts: n/a
the file comment.php goes where?

/includes ?
/admin

or in the same folder as index.php?

I'm going to test it out..
Reply With Quote
  #3  
Old 09-17-2006, 09:48 AM
blinking8s's Avatar
blinking8s+ Offline
über loafer
 
Join Date: Oct 2004
Location: Bowling Green, Ky
Posts: 3,428
Send a message via ICQ to blinking8s Send a message via AIM to blinking8s Send a message via MSN to blinking8s Send a message via Skype™ to blinking8s
im currently not getting any spam, so i cant help...even hidden areas of pixelpost.org development are spam free right now...weird.
__________________
i should say more clever stuff
Reply With Quote
  #4  
Old 09-17-2006, 05:48 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
comment.php goes with index.php file to root dir of Pixelpost installation.

PS I forgot to add that live demo of very similar solution (but without option of hashing variable names) is available to watch at:
http://blog.piotrgalas.com/

Feel free to test it and for that leave a comment
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #5  
Old 09-18-2006, 08:05 AM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
At evening there will be an update because thanks to Connie I found one small logical error which stoped Opera from posting comments.
There will be also added error number info which can help to debug comment script or just to find out why comment wasnt posted.
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #6  
Old 09-18-2006, 10:29 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
After deeper look in to the code there wasnt any big issue.

Template package (available from link at my signature or above) is updated right now with additional variable which makes all hashes unique for each virtual host directory.

As I found out (thx Connie) inside /templates/geos-nospam/scripts/lib.php
it would be good to replace relative URL:
HTML Code:
	advAJAX.post({
		url: "comment.php",
with absolute one i.e. like this:
HTML Code:
	advAJAX.post({
		url: "http://blog.piotrgalas.com/comment.php",
Now it should work fine in every conditions.

PS Tested with Firefox 1.0.3, Opera 9.01, MSIE 6.0 SP1 (XP edition) and MSIE 6.0 SP1 (w2k proff edition) .
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #7  
Old 09-22-2006, 01:33 PM
mrmastii Offline
forum loafer
 
Join Date: Jul 2005
Posts: 5
I have followed the instructions above.
My issues is, when a comment is submitted, the page get hung on http://<website>/index.php?x=save_comment.
No comment is getting submitted.

Please advise
Reply With Quote
  #8  
Old 09-22-2006, 06:09 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
Did you change index.php file and uploaded comment.php to root dir of Pixelpost??
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #9  
Old 09-26-2006, 03:25 PM
mrmastii Offline
forum loafer
 
Join Date: Jul 2005
Posts: 5
Sorry for replying late.
I did copy both files index.php and comment.php under root of my site.
Ps: These are the files that came with “geos_no_spam_template.rar’
Thanks
Reply With Quote
  #10  
Old 09-26-2006, 04:30 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
So it cant if you also took code from my image_template.html file and put to yours template file. Cut out from comment form <form> and </form> tags. Thanks to this hack both of them are useless.

First post in topic updated with installation instructions.
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 10:37 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs