4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 25, 2014, 05:37:15 AM

Login with username, password and session length
Search:     Advanced search
Follow 4images on twitter: Click here to follow!
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [Mod] Show user's lightbox to admin.
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3 4 5 » »» Print
This topic has not yet been rated!
Author Topic: [Mod] Show user's lightbox to admin.  (Read 53118 times)
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 549

mmm PHP...


View Profile WWW
« 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 ( Wink ) 4 files to modify:
member.php
search.php
/lang/<yourlanguage>/main.php
/templates/<yourtemplate>/member_profile.html


---------------------------------


Step 1.
Open member.php

Find:
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.php
Find:
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:
1
$search_id = array();
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.php

Add at the end, just before ?> :
1
$lang['show_user_lightbox'] = "Show user's lightbox";


Step 4.
Open /templates/<yourtemplate>/member_profile.html

Add 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

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Shap
Full Member
***
Offline Offline

Posts: 114

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #1 on: February 19, 2003, 06:19:02 AM »

Quote  [Expand]
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 Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 549

mmm PHP...


View Profile WWW
« Reply #2 on: February 19, 2003, 12:07:43 PM »

Quote from: Shap   [Expand]
Quote  [Expand]
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... Rolling Eyes
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Shap
Full Member
***
Offline Offline

Posts: 114

Thank You
-Given: 0
-Receive: 0


View Profile
« 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 Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 549

mmm PHP...


View Profile WWW
« 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

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Shap
Full Member
***
Offline Offline

Posts: 114

Thank You
-Given: 0
-Receive: 0


View Profile
« 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 Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 549

mmm PHP...


View Profile WWW
« Reply #6 on: February 19, 2003, 06:04:58 PM »

yes, dot means from current dir.
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Shap
Full Member
***
Offline Offline

Posts: 114

Thank You
-Given: 0
-Receive: 0


View Profile
« 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 Offline

Posts: 157

Thank You
-Given: 0
-Receive: 0


View Profile
« 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 Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 549

mmm PHP...


View Profile WWW
« Reply #9 on: February 24, 2003, 08:32:11 AM »

Quote from: Jasondavis   [Expand]
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  Wink
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Jasondavis
Full Member
***
Offline Offline

Posts: 157

Thank You
-Given: 0
-Receive: 0


View Profile
« 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 Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 549

mmm PHP...


View Profile WWW
« Reply #11 on: February 24, 2003, 09:01:37 AM »

Quote from: Jasondavis   [Expand]
Hi V@no did you test this? I made the changed, but i dont see any changes?

yes, I did
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Jasondavis
Full Member
***
Offline Offline

Posts: 157

Thank You
-Given: 0
-Receive: 0


View Profile
« 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 Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 549

mmm PHP...


View Profile WWW
« 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

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 549

mmm PHP...


View Profile WWW
« 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

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Pages: [1] 2 3 4 5 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
piqs.de - Fotocommunity & lizenzfreie Fotos
Page created in 0.247 seconds with 19 queries.
Post your comments here