Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 01-20-2007, 01:06 AM
imagiazone Offline
forum loafer
 
Join Date: Jan 2007
Location: Saint-Basile-Le-Grand (Quebec) Canada
Posts: 3
I need help with php

I have discovered PixelPost only few weeks ago and I think that it is a wonderfull application. I am putting the final touch of my near futur photoblog. I have been able to change and translate (in french) the templates quite easely . . well almost. Except for this.

When I am posting myself a comment, to answer a question asked by a visitor for example, It would be great if my own comment could be posted in a different color or format (different background color via a CSS ID). That way it will be easier to "spot" my answers in the comments list.

I am not very good with php and I am a bit afraid to spoil the code of the index.php. I did find out the place where this condition could be added and I think that the variable to use is "name".

Is anyone ever done this kind of modification before ? I would appreciate an help.

(Hope my writing is not that bad) Thx.

Jean Pierre Dagenais
Reply With Quote
  #2  
Old 01-20-2007, 03:33 AM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
If you can wait a little bit, I know of someone who is working on this feature.

Reply With Quote
  #3  
Old 01-20-2007, 08:15 AM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
In my blog my own name shows up in a different color when answering to a comment. I did a little hack in line 76 of functions.php for that.
original line:
PHP Code:
$comment_name "<a href=\"$comment_url\" title=\"$lang_visit_homepage\" target=\"new\" rel=\"nofollow\">$comment_name</a>"
hacked line:
PHP Code:
$comment_name "<a href=\"$comment_url\" title=\"$lang_visit_homepage\" target=\"new\" rel=\"nofollow\"".($comment_email==$cfgrow['email']?' style="color:red;"':'')."><b>$comment_name</b></a>"
Of course you can change "color:red" to nay other color you like.
When commenting you have to use the email adress you use in admin panel of pp and you have to submit an URL to get it work

dwilkinsjr, I am eager to see your solution in front end code!

LG
KArin
__________________
Uh!log Photoblog
My Addons

Last edited by GeoS; 01-20-2007 at 01:55 PM. Reason: Please use PHP tag for PHP code
Reply With Quote
  #4  
Old 01-20-2007, 11:09 AM
Dennis's Avatar
Dennis+ Offline
Team Pixelpost
 
Join Date: Jul 2006
Posts: 2,394
Send a message via MSN to Dennis
Quote:
Originally Posted by dwilkinsjr View Post
If you can wait a little bit, I know of someone who is working on this feature.
Hmm, I know someone who knows someone who told him yesterday he added it to Pixelpost 1.6 :P

It can be easily done, provided you use your admin-mail when leaving a comment:

Open functions.php in your includes folder:

look for:
PHP Code:
$image_comments .= "<li>".nl2br($comment_message)."<br />$comment_name @ $comment_datetime</li>"
replace with:
PHP Code:
if ($comment_email == $cfgrow['email']){
    
// admin comment
    
$image_comments .= "<li class=\"admin_comment\">$comment_message<br />$comment_name @ $comment_datetime</li>";
} else {
    
$image_comments .= "<li>$comment_message<br />$comment_name @ $comment_datetime</li>";

so now your own comments can be styled by CSS with the li.admin_comment property.
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
Reply With Quote
  #5  
Old 01-20-2007, 12:19 PM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Quote:
Originally Posted by austriaka View Post
dwilkinsjr, I am eager to see your solution in front end code!

LG
KArin
I personally did not have the solution

Quote:
Originally Posted by schonhose View Post
Hmm, I know someone who knows someone who told him yesterday he added it to Pixelpost 1.6
Reply With Quote
  #6  
Old 01-20-2007, 04:24 PM
imagiazone Offline
forum loafer
 
Join Date: Jan 2007
Location: Saint-Basile-Le-Grand (Quebec) Canada
Posts: 3
RE; php Help

Thank to all of you.

I think that the solution from Austriaka is simple, for me.

I will try it as soon as I can and then, I will be able to launch my blog.

In the mean time I have a Web site at www.imagiazone.com

Thx again.

Jean Pierre
Reply With Quote
  #7  
Old 01-22-2007, 06:00 PM
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
I personally want to see this sort of reply to post option built into pixelpost...
__________________
i should say more clever stuff
Reply With Quote
  #8  
Old 01-23-2007, 06:15 AM
Dennis's Avatar
Dennis+ Offline
Team Pixelpost
 
Join Date: Jul 2006
Posts: 2,394
Send a message via MSN to Dennis
Quote:
Originally Posted by blinking8s View Post
I personally want to see this sort of reply to post option built into pixelpost...
Then you know were to make a note of it. We can add it to 1.7 or higher.
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
Reply With Quote
  #9  
Old 01-23-2007, 01:20 PM
codepoit's Avatar
codepoit Offline
pixelpost guru
 
Join Date: Mar 2006
Location: Danbury, CT
Posts: 186
Quote:
Originally Posted by schonhose View Post
Hmm, I know someone who knows someone who told him yesterday he added it to Pixelpost 1.6 :P

It can be easily done, provided you use your admin-mail when leaving a comment:

Open functions.php in your includes folder:

look for:
PHP Code:
$image_comments .= "<li>".nl2br($comment_message)."<br />$comment_name @ $comment_datetime</li>"
replace with:
PHP Code:
if ($comment_email == $cfgrow['email']){
    
// admin comment
    
$image_comments .= "<li class=\"admin_comment\">$comment_message<br />$comment_name @ $comment_datetime</li>";
} else {
    
$image_comments .= "<li>$comment_message<br />$comment_name @ $comment_datetime</li>";

so now your own comments can be styled by CSS with the li.admin_comment property.
Let me preface my reply by saying I'm not a PHP or CSS expert by any means. That being said, I'm having no luck at all using this solution. I pasted the code into functions.php, and created a new css class in my style sheet. I think that's where the problem is, because I just can't get it to recognize the style of admin_comment. I've played with how I name it in CSS (.admin_comment, #admin_comment, .admin_comment li, li.admin_comment, etc...) and I just can't get it to work.

Care to give me some pointers?

Thanks,
Chris
__________________
The Last Rewind
Reply With Quote
  #10  
Old 01-23-2007, 03:44 PM
Dennis's Avatar
Dennis+ Offline
Team Pixelpost
 
Join Date: Jul 2006
Posts: 2,394
Send a message via MSN to Dennis
Yup, .admin_comment or li.admin_comment should work and try a hard refresh (CTRL-F5) to clear your cache.
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 03:27 AM.

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