Author Topic: [Mod] Show user's lightbox to admin.  (Read 89383 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Show user's lightbox to admin.
« 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:
Code: [Select]
   $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:
Code: [Select]
    $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:
Code: [Select]
include(ROOT_PATH.'global.php');
Add after:
Code: [Select]
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:
Code: [Select]
$search_id = array();Add after:
Code: [Select]
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 ?> :
Code: [Select]
$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:
Code: [Select]
{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 »
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)

Offline Shap

  • Full Member
  • ***
  • Posts: 114
    • View Profile
[Mod] Show user's lightbox to admin.
« Reply #1 on: February 19, 2003, 06:19:02 AM »
Quote
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>

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Show user's lightbox to admin.
« Reply #2 on: February 19, 2003, 12:07:43 PM »
Quote from: Shap
Quote
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... :roll:
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)

Offline Shap

  • Full Member
  • ***
  • Posts: 114
    • View Profile
[Mod] Show user's lightbox to admin.
« Reply #3 on: February 19, 2003, 04:29:51 PM »
any idea why its not working for me?

why would it show
Code: [Select]
<A href="./search.php?search_lightbox=20">Show user's lightbox</a>

instead of creating a  link?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Show user's lightbox to admin.
« 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?
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)

Offline Shap

  • Full Member
  • ***
  • Posts: 114
    • View Profile
[Mod] Show user's lightbox to admin.
« 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>

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Show user's lightbox to admin.
« Reply #6 on: February 19, 2003, 06:04:58 PM »
yes, dot means from current dir.
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)

Offline Shap

  • Full Member
  • ***
  • Posts: 114
    • View Profile
[Mod] Show user's lightbox to admin.
« 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!

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
help
« 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?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: help
« Reply #9 on: February 24, 2003, 08:32:11 AM »
Quote from: Jasondavis
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:
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)

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
thanks
« 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?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: thanks
« Reply #11 on: February 24, 2003, 09:01:37 AM »
Quote from: Jasondavis
Hi V@no did you test this? I made the changed, but i dont see any changes?

yes, I did
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)

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
[Mod] Show user's lightbox to admin.
« 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.....

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Show user's lightbox to admin.
« 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)
Code: [Select]
"lang_show_user_lightbox" => $lang['show_user_lightbox']." (".$num_rows_all.")",
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)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Show user's lightbox to admin.
« 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)
Code: [Select]
"lang_show_user_lightbox" => $lang['show_user_lightbox']." (".$num_rows_all.")",
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)