V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
   
Offline
Posts: 17849
Thank You
-Given: 47
-Receive: 498
mmm PHP...
|
 |
« on: February 13, 2003, 07:45:53 AM » |
|
The simples way to do is use search engine to display someone's lightbox using image ids. -------------------------------- Only (  ) 4 files to modify: member.php search.php /lang/<yourlanguage>/main.php /templates/<yourtemplate>/member_profile.html--------------------------------- Step 1.Open member.phpFind: 1 2 3
| $site_template->register_vars(array( "user_id" => $user_row['user_id'], "user_name" => (isset($user_row['user_name'])) ? htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY, |
Replace with: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| $sql = "SELECT * FROM ".LIGHTBOXES_TABLE." WHERE ".get_user_table_field("", "user_id")." = ".$user_row['user_id']; $user_lightbox_info = $site_db->query_firstrow($sql); $num_rows_all = 0; if (!empty($user_lightbox_info['lightbox_image_ids'])) { $image_id_sql = str_replace(" ", ",", trim($user_lightbox_info['lightbox_image_ids'])); $sql = "SELECT COUNT(image_id) AS images FROM ".IMAGES_TABLE." WHERE image_active = 1 AND image_id IN ($image_id_sql)"; $result = $site_db->query_firstrow($sql); $num_rows_all = $result['images']; } $site_template->register_vars(array( "lang_show_user_lightbox" => $lang['show_user_lightbox']." (".$num_rows_all.")", "url_show_user_lightbox" => ($user_info['user_level'] == ADMIN) ? $site_sess->url(ROOT_PATH."search.php?search_lightbox=".$user_row['user_id']) : "", "user_id" => $user_row['user_id'], "user_name" => (isset($user_row['user_name'])) ? htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY, |
Step 2.Open search.phpFind: 1
| include(ROOT_PATH.'global.php'); |
Add after: 1 2 3 4 5 6 7 8 9
| if (isset($HTTP_POST_VARS['search_lightbox']) || isset($HTTP_GET_VARS['search_lightbox'])) { $search_lightbox = intval((isset($HTTP_POST_VARS['search_lightbox'])) ? trim($HTTP_POST_VARS['search_lightbox']) : trim($HTTP_GET_VARS['search_lightbox'])); if ($search_lightbox) { $show_result = 1; } } else { $search_lightbox = ""; } |
2.2.Find: Add after: 1 2 3 4 5 6 7 8 9 10
| if ($user_info['user_level'] == ADMIN){; if ($search_lightbox != ""){ $sql = "SELECT * FROM ".LIGHTBOXES_TABLE." WHERE ".get_user_table_field("", "user_id")." = $search_lightbox"; $search_lightbox_info = $site_db->query_firstrow($sql); $search_lightbox_ids = str_replace(" ", ",", trim($search_lightbox_info['lightbox_image_ids'])); $search_id['image_ids'] = $search_lightbox_ids; } } |
Step 3.Open /lang/<yourlanguage>/main.phpAdd at the end, just before ?> : 1
| $lang['show_user_lightbox'] = "Show user's lightbox"; |
Step 4.Open /templates/<yourtemplate>/member_profile.htmlAdd where ever u want to display Show user's lightbox: 1
| {if url_show_user_lightbox}<A href="{url_show_user_lightbox}">{lang_show_user_lightbox}</a>{endif url_show_user_lightbox} |
now, when u logged in as admin, go view an user's profile.
|
|
|
|
|
« Last Edit: January 26, 2009, 03:52:00 PM by V@no »
|
Logged
|
|
|
|
Shap
Full Member
 
Offline
Posts: 114
Thank You
-Given: 0
-Receive: 0
|
 |
« Reply #1 on: February 19, 2003, 06:19:02 AM » |
|
Step 4. Open /templates/<yourtemplate>/member_profile.html
Add where ever u want to display Show user's lightbox: Code: {if url_show_user_lightbox}<A href="{url_show_user_lightbox}">{lang_show_user_lightbox}</a>{endif url_show_user_lightbox} This doesnt seem to be right... When I click on a profiles. all its showing me is <A href="./search.php?search_lightbox=20">Show user's lightbox</a>
|
|
|
|
|
|
Logged
|
|
|
|
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
   
Offline
Posts: 17849
Thank You
-Given: 47
-Receive: 498
mmm PHP...
|
 |
« Reply #2 on: February 19, 2003, 12:07:43 PM » |
|
Step 4. Open /templates/<yourtemplate>/member_profile.html
Add where ever u want to display Show user's lightbox: Code: {if url_show_user_lightbox}<A href="{url_show_user_lightbox}">{lang_show_user_lightbox}</a>{endif url_show_user_lightbox} This doesnt seem to be right... When I click on a profiles. all its showing me is <A href="./search.php?search_lightbox=20">Show user's lightbox</a> looks good to me... 
|
|
|
|
|
|
Logged
|
|
|
|
Shap
Full Member
 
Offline
Posts: 114
Thank You
-Given: 0
-Receive: 0
|
 |
« Reply #3 on: February 19, 2003, 04:29:51 PM » |
|
any idea why its not working for me? why would it show 1
| <A href="./search.php?search_lightbox=20">Show user's lightbox</a> |
instead of creating a link?
|
|
|
|
|
|
Logged
|
|
|
|
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
   
Offline
Posts: 17849
Thank You
-Given: 47
-Receive: 498
mmm PHP...
|
 |
« Reply #4 on: February 19, 2003, 04:41:20 PM » |
|
did u look in the source of your page, maybe there is something else messing with this link?
|
|
|
|
|
|
Logged
|
|
|
|
Shap
Full Member
 
Offline
Posts: 114
Thank You
-Given: 0
-Receive: 0
|
 |
« Reply #5 on: February 19, 2003, 05:58:34 PM » |
|
I'll take a look, but is it suppost to have the "." before /search.php?
<A href="./search.php?search_lightbox=20">Show user's lightbox</a>
|
|
|
|
|
|
Logged
|
|
|
|
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
   
Offline
Posts: 17849
Thank You
-Given: 47
-Receive: 498
mmm PHP...
|
 |
« Reply #6 on: February 19, 2003, 06:04:58 PM » |
|
yes, dot means from current dir.
|
|
|
|
|
|
Logged
|
|
|
|
Shap
Full Member
 
Offline
Posts: 114
Thank You
-Given: 0
-Receive: 0
|
 |
« Reply #7 on: February 19, 2003, 06:51:48 PM » |
|
haha..without being in front of it, I just realized what the problem was..I'm an idiot! I'm using dreamweaver and put the code on the "design view" Page, instead of inside the source code..
Once I get home, I'll double check thats the problem, but pretty sure it is!
|
|
|
|
|
|
Logged
|
|
|
|
Jasondavis
Full Member
 
Offline
Posts: 157
Thank You
-Given: 0
-Receive: 0
|
 |
« Reply #8 on: February 24, 2003, 07:46:37 AM » |
|
hey i love this mod, but when browsing through a lot of my users profiles, there is no way to see if they have any images in the lightbox without clicking the link....would there be a way to have the number of images in the lightbox displayed next to the link to there lightbox?
|
|
|
|
|
|
Logged
|
|
|
|
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
   
Offline
Posts: 17849
Thank You
-Given: 47
-Receive: 498
mmm PHP...
|
 |
« Reply #9 on: February 24, 2003, 08:32:11 AM » |
|
hey i love this mod, but when browsing through a lot of my users profiles, there is no way to see if they have any images in the lightbox without clicking the link....would there be a way to have the number of images in the lightbox displayed next to the link to there lightbox? do again Step 1.. I fixed it 
|
|
|
|
|
|
Logged
|
|
|
|
Jasondavis
Full Member
 
Offline
Posts: 157
Thank You
-Given: 0
-Receive: 0
|
 |
« Reply #10 on: February 24, 2003, 08:50:03 AM » |
|
Hi V@no did you test this? I made the changed, but i dont see any changes?
|
|
|
|
|
|
Logged
|
|
|
|
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
   
Offline
Posts: 17849
Thank You
-Given: 47
-Receive: 498
mmm PHP...
|
 |
« Reply #11 on: February 24, 2003, 09:01:37 AM » |
|
Hi V@no did you test this? I made the changed, but i dont see any changes? yes, I did 
|
|
|
|
|
|
Logged
|
|
|
|
Jasondavis
Full Member
 
Offline
Posts: 157
Thank You
-Given: 0
-Receive: 0
|
 |
« Reply #12 on: February 24, 2003, 09:09:08 PM » |
|
V@no that is exactly what I was looking for! the only problem is that I cant get it to work for some raeson..... 
|
|
|
|
|
|
Logged
|
|
|
|
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
   
Offline
Posts: 17849
Thank You
-Given: 47
-Receive: 498
mmm PHP...
|
 |
« Reply #13 on: February 24, 2003, 11:40:38 PM » |
|
are u sure if redid Step 1.? I dont think so, because if there was some problem, u'd get this: Show user's Favorites ()and this is the actual line, that supposed to print on display (X) 1
| "lang_show_user_lightbox" => $lang['show_user_lightbox']." (".$num_rows_all.")", |
|
|
|
|
|
|
Logged
|
|
|
|
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
   
Offline
Posts: 17849
Thank You
-Given: 47
-Receive: 498
mmm PHP...
|
 |
« Reply #14 on: February 24, 2003, 11:41:32 PM » |
|
are u sure that u redid Step 1.? I dont think so, because if there was some problem, u'd get atleast this: Show user's Favorites ()and this is the actual line, that supposed to print on display (X) 1
| "lang_show_user_lightbox" => $lang['show_user_lightbox']." (".$num_rows_all.")", |
|
|
|
|
|
|
Logged
|
|
|
|
|