Author Topic: .  (Read 168641 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 :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Letze aktive User / Last active users
« Reply #15 on: April 07, 2005, 12:33:19 AM »
with the new template engine, u can not parse template and then register tags for it, tags must be registered before parsing a template (that's actualy should be done in the first place, but we were spoiled with v1.7 that didnt care about it).

so, replace
Code: [Select]
$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
 "user_last_action_box" => $user_last_action_box,
 "lang_user_last_action" => $lang['lang_user_last_action'],   
 "user_last_action_list" => $last_action_user_list
));
with:
Code: [Select]
$site_template->register_vars(array(
 "lang_user_last_action" => $lang['lang_user_last_action'],   
 "user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));
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 ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [Mod] Letze aktive User / Last active users
« Reply #16 on: April 07, 2005, 12:49:49 AM »
Thanks V@no

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [Mod] Letze aktive User / Last active users
« Reply #17 on: April 30, 2005, 11:05:51 PM »
Hi I want to show the personal picture nest to the name but i'm getting errors i have try this:

Code: [Select]
$sql = "SELECT user_name, user_id, userpic, user_lastaction FROM ".USERS_TABLE."
and this:

Code: [Select]
$last_action_user_list .= "<img src="'.ROOT_PATH.'/data/userpic/'.((empty($row['userpic'])) ? "noimage.png" : $row['userpic']).'" width="37" height="39"><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
What i'mdoing wrong?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Letze aktive User / Last active users
« Reply #18 on: May 01, 2005, 04:39:22 AM »
lets
What i'mdoing wrong?
lets see...u've mentioned about an error messages but u didnt provide it - thats wrong ;)
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 Toso

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Lachs & Leder
Re: [Mod] Letze aktive User / Last active users
« Reply #19 on: May 04, 2005, 12:53:49 PM »
Hey Cr@zy Sash,

ist es möglich zu dem ADD-ON für heute, trotzdem die Uhrzeit anzeigen zu lassen?

z.B.
Toso - Heute - 12:53

Offline Toso

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Lachs & Leder
Re: [Mod] Letze aktive User / Last active users
« Reply #20 on: May 09, 2005, 09:00:57 AM »
Vielleicht jemand ne Idee?

Offline Toso

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Lachs & Leder
Re: [Mod] Letze aktive User / Last active users
« Reply #21 on: June 15, 2005, 09:37:18 AM »
Hey Cr@zy Sash,

ist es möglich zu dem ADD-ON für heute, trotzdem die Uhrzeit anzeigen zu lassen?

z.B.
Toso - Heute - 12:53

Huhu? Kannst du mir helfen, Cr@zy Sash?

Offline Toso

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Lachs & Leder
Re: [Mod] Letze aktive User / Last active users
« Reply #22 on: June 16, 2005, 09:04:58 AM »
Das ist meine page_header.php


Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: page_header.php                                      *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7                                                  *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) f&uuml;r weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die("Security violation");
}

// Cache Templates
$template_list 'header,footer,category_dropdown_form,user_logininfo,user_loginform';
if (isset(
$templates_used) && $templates_used != "") {
  $template_list $template_list.",".$templates_used;
}
$site_template->cache_templates($template_list);

//-----------------------------------------------------
//--- Register Global Vars ----------------------------
//-----------------------------------------------------
$total_images 0;
$total_categories 0;
$auth_cat_sql['auth_viewcat']['IN'] = 0;
$auth_cat_sql['auth_viewcat']['NOTIN'] = 0;
if (!empty(
$cat_cache)) {
  foreach ($cat_cache as $key => $val) {
    if (check_permission("auth_viewcat"$key)) {
      $total_categories++;
      if (isset($val['num_images'])) {
        $total_images += $val['num_images'];
      }
      else {
        $cat_cache[$key]['num_images'] = 0;
      }
      $auth_cat_sql['auth_viewcat']['IN'] .= ", ".$key;
    }
    else {
      $auth_cat_sql['auth_viewcat']['NOTIN'] .= ", ".$key;
    }
  }
}

$site_template->register_vars(array(
  "media_url" => MEDIA_PATH,
  "thumb_url" => THUMB_PATH,
  "icon_url" => ICON_PATH,
  "template_url" => TEMPLATE_PATH,
  "template_image_url" => TEMPLATE_PATH."/images",
  "template_lang_image_url" => TEMPLATE_PATH."/images_".$config['language_dir'],
  "site_name" => $config['site_name'],
  "site_email" => $config['site_email'],
  "self" => $site_sess->url($self_url),
  "self_full" => $site_sess->url($script_url."/".$self_url),
  "script_version" => SCRIPT_VERSION,
  "cp_link" => ($user_info['user_level'] != ADMIN) ? "" "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php")."\">Control Panel</a>]</p>\n",
  "total_categories" => $total_categories,
  "total_images" => $total_images,
  "url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),
  "url_top_images" => $site_sess->url(ROOT_PATH."top.php"),
  "url_potm_link" => $site_sess->url(ROOT_PATH."potm.php"),
  "url_top_cat_images" => $site_sess->url(ROOT_PATH."top.php".(($cat_id && preg_match("/categories.php/"$self_url)) ? "?".URL_CAT_ID."=".$cat_id "")),
  "url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(ROOT_PATH."register.php"),
  "url_search" => $site_sess->url(ROOT_PATH."search.php"),
  "url_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php"),
  "url_userlist" => $site_sess->url(ROOT_PATH."memberlist.php"),
  "url_control_panel" => (!empty($url_control_panel)) ? $site_sess->url($url_control_panel) : $site_sess->url(ROOT_PATH."member.php?action=editprofile"),
  "url_categories" => $site_sess->url(ROOT_PATH."categories.php"),
  "url_home" => $site_sess->url(ROOT_PATH."index.php"),
  "url_login" => (!empty($url_login)) ? $site_sess->url($url_login) : $site_sess->url(ROOT_PATH."login.php"),
  "url_logout" => (!empty($url_logout)) ? $site_sess->url($url_logout) : $site_sess->url(ROOT_PATH."logout.php"),
  "url_member" => (!empty($url_member)) ? $site_sess->url($url_member) : $site_sess->url(ROOT_PATH."member.php"),
  "url_upload" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform"),
  "url_lost_password" => (!empty($url_lost_password)) ? $site_sess->url($url_lost_password) : $site_sess->url(ROOT_PATH."member.php?action=lostpassword")
));

if (!empty(
$additional_urls)) {
  $register_array = array();
  foreach ($additional_urls as $key => $val) {
    $register_array[$key] = $site_sess->url($val);
  }
  $site_template->register_vars($register_array);
}

// Replace Globals in $lang
$lang $site_template->parse_array($lang);

$site_template->register_vars(array(
  "lang_site_stats" => $lang['site_stats'],
  "lang_registered_user" => $lang['registered_user'],
  "lang_random_image" => $lang['random_image'],
  "lang_categories" => $lang['categories'],
  "lang_sub_categories" => $lang['sub_categories'],
  "lang_new_images" => $lang['new_images'],
  "lang_top_images" => $lang['top_images'],
  "lang_potm_link" => $lang['potm_link'],
  "lang_search" => $lang['search'],
  "lang_advanced_search" => $lang['advanced_search'],
  "lang_lightbox" => $lang['lightbox'],
  "lang_userlist_title" => $lang['lang_userlist_title'],
  "lang_register" => $lang['register'],
  "lang_control_panel" => $lang['control_panel'],
  "lang_login" => $lang['login'],
  "lang_auto_login" => $lang['lang_auto_login'],
  "lang_logout" => $lang['logout'],
  "lang_lost_password" => $lang['lost_password'],
  "lang_user_name" => $lang['user_name'],
  "lang_password" => $lang['password'],
  "lang_go" => $lang['go'],
  "lang_images_per_page" => $lang['images_per_page'],
  "lang_user_online" => $lang['user_online'],
  "lang_user_online_detail" => $lang['user_online_detail'],
  "charset" => $lang['charset'],
  "direction" => $lang['direction']
));

//-----------------------------------------------------
//--- Category Dropdown -------------------------------
//-----------------------------------------------------
$category_dropdown_selfjump get_category_dropdown($cat_id1);
$site_template->register_vars("category_dropdown_selfjump"$category_dropdown_selfjump);
$category_dropdown_form $site_template->parse_template("category_dropdown_form");
$site_template->register_vars(array("category_dropdown_form" => $category_dropdown_form));

$site_template->un_register_vars("category_dropdown_selfjump");
unset(
$category_dropdown_selfjump);
unset(
$category_dropdown_form);

//-----------------------------------------------------
//--- Random Image ------------------------------------
//-----------------------------------------------------
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" get_random_image();
$site_template->register_vars("random_image"$random_image);
unset(
$random_image);

//-----------------------------------------------------
//--- Set Paging Vars ---------------------------------
//-----------------------------------------------------
if (isset($HTTP_POST_VARS['setperpage'])) {
  $setperpage intval($HTTP_POST_VARS['setperpage']);
  if ($setperpage) {
    $site_sess->set_session_var("perpage"$setperpage);
    $session_info['perpage'] = $setperpage;
  }
}

if (isset(
$session_info['perpage'])) {
  $perpage $session_info['perpage'];
}
else {
  $perpage ceil($config['default_image_rows'] * $config['image_cells']);
}

//-----------------------------------------------------
//--- Set Perpage Dropdown ----------------------------
//-----------------------------------------------------
$setperpage_dropdown "\n<select name=\"setperpage\" class=\"setperpageselect\">\n";
for(
$i 1$i <= $config['custom_row_steps']; $i++) {
  $setvalue $config['image_cells'] * $i;
  $setperpage_dropdown .= "<option value=\"".$setvalue."\"";
    if ($setvalue == $perpage) {
    $setperpage_dropdown .= " selected=\"selected\"";
  }
  $setperpage_dropdown .= ">";
  $setperpage_dropdown .= $setvalue;
  $setperpage_dropdown .= "</option>\n";
}
$setperpage_dropdown .= "</select>\n";
if (
$cat_id != 0) {
  $setperpage_dropdown .= "<input type=\"hidden\" name=\"cat_id\" value=\"".$cat_id."\" />\n";
}
if (isset(
$show_result) && $show_result == 1) {
  $setperpage_dropdown .= "<input type=\"hidden\" name=\"show_result\" value=\"1\" />\n";
}
$site_template->register_vars("setperpage_dropdown"$setperpage_dropdown);
$setperpage_dropdown_form $site_template->parse_template("setperpage_dropdown_form");
$site_template->register_vars("setperpage_dropdown_form"$setperpage_dropdown_form);

$site_template->un_register_vars("setperpage_dropdown");
unset(
$setperpage_dropdown);
unset(
$setperpage_dropdown_form);

//-----------------------------------------------------
//--- Add & Delete from Lists -------------------------
//-----------------------------------------------------
if ($action == "addtolightbox" && $id) {
  if ($user_info['user_level'] >= USER) {
    $msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];
  }
  else {
    $msg $lang['lightbox_register'];
  }
}
if (
$action == "removefromlightbox" && $id) {
  if ($user_info['user_level'] >= USER) {
    $msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];
  }
  else {
    $msg $lang['lightbox_register'];
  }
}
if (
$action == "clearlightbox") {
  if ($user_info['user_level'] >= USER) {
    $msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];
  }
  else {
    $msg $lang['lightbox_register'];
  }
}

//-----------------------------------------------------
//--- Save Rating -------------------------------------
//-----------------------------------------------------
if ($action == "rateimage" && $id) {
  $rating intval($HTTP_POST_VARS['rating']);
  $cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME "4images_";
  $cookie_rated = isset($HTTP_COOKIE_VARS[$cookie_name.'rated']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'rated'])) : array();
  if ($rating && $rating <= MAX_RATING && $id) {
    if (!isset($session_info['rated_imgs'])) {
      $session_info['rated_imgs'] = $site_sess->get_session_var("rated_imgs");
    }    
    $split_list 
= array();
    if (!empty($session_info['rated_imgs'])) {
      $split_list explode(" "$session_info['rated_imgs']);
    }
    if (!in_array($id$split_list) && !in_array($id$cookie_rated)) {
      $session_info['rated_imgs'] .= " ".$id;
      $session_info['rated_imgs'] = trim($session_info['rated_imgs']);
      $site_sess->set_session_var("rated_imgs"$session_info['rated_imgs']);
      $cookie_rated[] = $id;
      $cookie_expire time() + 60 60 24 4;
      setcookie($cookie_name.'rated'serialize($cookie_rated), $cookie_expireCOOKIE_PATHCOOKIE_DOMAINCOOKIE_SECURE);
      update_image_rating($id$rating);
      $msg $lang['voting_success'];
    }
    else {
      $msg $lang['already_voted'];
    }
  }
  else {
    $msg $lang['voting_error'];
  }
}

//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
  $header $site_template->parse_template("header");
  $footer $site_template->parse_template("footer");
  $site_template->register_vars(array(
    "header" => $header,
    "footer" => $footer
  
));
  unset($header);
  unset($footer);
}

//-----------------------------------------------------
//--- User Box ----------------------------------------
//-----------------------------------------------------
if ($user_info['user_level'] >= USER) {
  $site_template->register_vars("lang_loggedin_msg"preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU"$user_info['user_name'], $lang['lang_loggedin_msg']));
  $user_box $site_template->parse_template("user_logininfo");
  $site_template->register_vars(array(
    "user_box" => $user_box,
    "user_loggedin" => 1,
    "user_loggedout" => 0,
    "is_admin" => ($user_info['user_level'] == ADMIN) ? 0
  
));  
  $site_template
->un_register_vars("user_logininfo");
  unset($user_box);
}
else {
  $user_box $site_template->parse_template("user_loginform");
  $site_template->register_vars(array(
    "user_box" => $user_box,
    "user_loggedin" => 0,
    "user_loggedout" => 1,
    "is_admin" => 0
  
));
  $site_template->un_register_vars("user_loginform");
  unset($user_box);
}
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                 WHERE user_level >= '"
.GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 10"
;
    $result $site_db->query($sql);

while (
$row $site_db->fetch_array($result)) { 
   if(date("dmy"$row['user_lastaction']) == date("dmy")) { 
  $last_user_date $lang['lang_user_last_today']; 
  }else { 
  $last_user_date format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']); 
  }    
  $last_action_user_list 
.= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>"
   }

$user_last_action_box $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
  "user_last_action_box" => $user_last_action_box,
  "lang_user_last_action" => $lang['lang_user_last_action'],
  "user_last_action_list" => $last_action_user_list
));
  unset($user_last_action_box);
  unset($last_action_user_list);
?>


Offline Toso

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Lachs & Leder
Re: [Mod] Letze aktive User / Last active users
« Reply #23 on: June 16, 2005, 12:20:41 PM »
Perfekt.  :mrgreen:
Vielen Vielen Danke!!!!!!!!!!

Offline geohei

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: [Mod] Letze aktive User / Last active users
« Reply #24 on: August 20, 2005, 02:18:33 AM »
Also bei mir geht gar nix. Ich habe 1.7.1 und hier sind alle Schritte die ich gemacht habe dokumentiert.
http://www.geohei.lu/geoheiBB/viewtopic.php?t=429

Würde mich freuen wenn mir jemand sagen könnte was hier schief läuft.

Grüße,

Offline udaman

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [Mod] Letze aktive User / Last active users
« Reply #25 on: August 31, 2005, 01:26:42 AM »
Hi everyone! Can someone tell me what I need to change to exclude Admins from this list. We have 3 Admins and I don't want them to show up in a list. Thanks!

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [Mod] Letze aktive User / Last active users
« Reply #26 on: August 31, 2005, 02:32:45 AM »
hi udaman,
replace this :
Code: [Select]
...
WHERE user_level >= '".GUEST."'
...
with this :
Code: [Select]
...
WHERE user_level < '".ADMIN."'
...

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline udaman

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [Mod] Letze aktive User / Last active users
« Reply #27 on: August 31, 2005, 05:34:34 AM »
I am actually using the following code and I tried replacing the WHERE user_level >= '".GUEST."' part with your code but it didn't do anything:

Code: [Select]
WHERE user_level >= '".GUEST."'".(($user_info['user_level'] == ADMIN) ? "" : " AND user_invisible = 0")." OR user_id = ".$user_info['user_id']."
Thank you for replying though!

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [Mod] Letze aktive User / Last active users
« Reply #28 on: August 31, 2005, 09:56:20 AM »
... test it with IE (logged in) and at the same time with FF (not logged in) ... and you see the difference ...  :!:

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline udaman

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [Mod] Letze aktive User / Last active users
« Reply #29 on: September 03, 2005, 10:34:37 AM »
It works! Thank you very very much!