Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Addon for Album... 
 
Hile, Neighbours and friends...

After long time Out in "todash" I'm here again...

Today I made 2 modifications to the album for:

1.- View how many votes an image has
2.- View who rated the photo.

To do so:

Open album_showpage.php

Find
Code: [Download] [Hide]
  1. $sql = "SELECT p.*, ac.*, u.user_id, u.username, u.user_rank, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT( DISTINCT c.comment_id) AS comments_count 


InLine After add
Code: [Download] [Hide]
  1. , COUNT( DISTINCT r.rate_user_id) AS rate_count  


Find
Code: [Download] [Hide]
  1. $total_comments = $thispic['comments_count']; 


After add
Code: [Download] [Hide]
  1. $total_ratings = $thispic['rate_count']; 


Find
Code: [Download] [Hide]
  1. if( empty($thispic) )  
  2. {  
  3.     message_die(GENERAL_ERROR, $lang['Pic_not_exist'] . $lang['Nav_Separator'] . $pic_id);  


After add
Code: [Download] [Hide]
  1. // ------------------------------------  
  2. // Check users that voted  
  3. // ------------------------------------  
  4.  
  5. $sql = "SELECT r.rate_user_id, u.user_id, u.username  
  6.         FROM " . ALBUM_RATE_TABLE . " AS r  
  7.             LEFT JOIN ". USERS_TABLE ." AS u on r.rate_user_id = u.user_id  
  8.         WHERE rate_pic_id = '$pic_id'  
  9.         ORDER BY rate_user_id" ;  
  10. if($result = $db->sql_query($sql))  
  11. {  
  12.     if (!empty($result))  
  13.     {  
  14.         while ($users_rated = $db->sql_fetchrow($result))  
  15.         {  
  16.             $style_color = color_group_colorize_name($users_rated['user_id']);  
  17.             $users_that_rated .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $users_rated['user_id']) . '" class="gensmall">' . $style_color . '</a>, ';  
  18.         }  
  19.     }  
  20.     $db->sql_freeresult($result);  
  21. }  
  22. if (!$users_that_rated)  
  23. {  
  24.     $users_that_rated = '<i>' . $lang['no_one_rated'] . '</i>';  
  25. }  
  26.  
  27. // ------------------------------------  
  28. // End Check users that voted  
  29. // ------------------------------------  
  30.  


Find:
Code: [Download] [Hide]
  1.         'PIC_COMMENTS' => $total_comments, 


After add:
Code: [Download] [Hide]
  1.         'PIC_RATINGS_COUNT' => $total_ratings,  
  2.         'TOTAL_USERS_VOTED' => $users_that_rated,  
  3.  


Find:
Code: [Download] [Hide]
  1.         'L_RATING' => $lang['Rating'], 


After add:
Code: [Download] [Hide]
  1.         'L_TOTAL_RATINGS' => $lang['total_ratings'],  
  2.         'L_USERS_VOTED' => $lang['users_voted'],  
  3.  



Open templates/*/album_showpage_body.tpl
Find:
Code: [Download] [Hide]
  1.                 <!-- END rate_switch --> 


Before add:
Code: [Download] [Hide]
  1.                 <tr>  
  2.                     <td valign="top" align="right"><span class="genmed">{L_TOTAL_RATINGS}:</td>  
  3.                     <td valign="top" align="left"><b><span class="genmed">{PIC_RATINGS_COUNT}</b></td>  
  4.                 </tr>  
  5.                 <tr>  
  6.                     <td valign="top" align="right"><span class="genmed">{L_USERS_VOTED}:</td>  
  7.                     <td valign="top" align="left"><b><span class="genmed">{TOTAL_USERS_VOTED}</b></td>  
  8.                 </tr>  
  9.  


Open language/*/lang_album_main.php
Find
Code: [Download] [Hide]
  1. $lang['Album_rate_successfully'] = 'Your pic has been rated successfully'; 


After add
Code: [Download] [Hide]
  1. $lang['total_ratings']='Total Rates';  
  2. $lang['no_one_rated'] = 'Nobody still rated';  
  3. $lang['users_voted'] = 'Users that already rated'; 


Save / Close All Files

I feel sorry for a new DB query... I'm sure that it could have been done without it, but I've been unable.

You can see an example here: http://www.ka-tet-corp.com/portal2.....php?pic_id=803

rating

I've tested it on a live phpBB XS 2
 




____________
Icy Phoenix Latest 2.0 (working pending)
Style: Aphrodite and MG_Themes
Site: Spanish Stephen King fan forum
Mods: Medal System Mod. BBAntispam 1.2. Several own BBcodes.
 
Edited by Xusqui, Sun 18 Mar, 2007 08:51: Remove extra lines
XusquiSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Addon for Album... 
 
great work

thanks for sharing it here =)
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Addon for Album... 
 
Little bug:

in album_showpage.php

FIND:
Code: [Download] [Hide]
  1. , COUNT(r.rate_point) AS rate_count  


Replace with:
Code: [Download] [Hide]
  1. , COUNT( DISTINCT r.rate_user_id) AS rate_count  


1st post updated!
 




____________
Icy Phoenix Latest 2.0 (working pending)
Style: Aphrodite and MG_Themes
Site: Spanish Stephen King fan forum
Mods: Medal System Mod. BBAntispam 1.2. Several own BBcodes.
 
XusquiSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Addon for Album... 
 
Hi Xusqui,
I'm glad to see you back again.

Thanks for your modification... there is still a small bug in it... anyway I think I'll review it and add to Icy Phoenix so you don't need to fix the bug... just give me the time to  test everything is needed to.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Addon for Album... 
 
This modification is only for php XS and maybe is not working with IcyPhoenix.

If you are the author or are able to make them icy compatible, please feel free to post it.    

Thanks for your time and the good work so far.

 




____________
? Zuker - EDDB - LPM - Sharefields
 
ZukerSend private messageVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron