Author Topic: how can iadd last member name ?  (Read 13000 times)

0 Members and 1 Guest are viewing this topic.

Offline bikoo

  • Newbie
  • *
  • Posts: 25
    • View Profile
how can iadd last member name ?
« on: May 30, 2005, 10:06:52 PM »
i need add name of last member Register my album wiz welcome msg  ?
how ??
plz help me

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: how can i add last member name ?
« Reply #1 on: May 31, 2005, 12:20:15 AM »
hi bikoo,

Quote
how can i add last member name (as link to profile) in home.html e.g. ?

1.Step
open index.php and find :
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------


add before :

Code: [Select]
//-----------------------------------------------------
// --- Newest username -----
//-----------------------------------------------------
  $sql = "SELECT user_name, user_id
          FROM ".USERS_TABLE."
          WHERE user_level > ".USER_AWAITING."
          ORDER BY user_id DESC";
  $row = $site_db->query_firstrow($sql);

  $newest_user ="<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a>";
  $lang_newest_user = $lang['newest_user'];
 
  $site_template->register_vars("newest_user", $newest_user);
  unset($newest_user);

//-----------------------------------------------------

2.Step
open home.html and add where you want :
Code: [Select]
Welcome our newest user {newest_user} !

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 bikoo

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: how can iadd last member name ?
« Reply #2 on: June 01, 2005, 07:12:14 AM »
thnx aloot man
gr8 job

TheOracle

  • Guest
Re: how can iadd last member name ?
« Reply #3 on: June 02, 2005, 04:00:00 PM »
Since I'm personnally interested in this MOD, I'd like to give my inputs.

If I may suggest some replacement codes - due to missing components from index.php file, some missing calls from the WHERE statement and, since the $lang string were being used from the index.php file but not being called elsewhere, I added these statements in the correction below.

Replace :

Quote

//-----------------------------------------------------
// --- Newest username -----
//-----------------------------------------------------
  $sql = "SELECT user_name, user_id
          FROM ".USERS_TABLE."
          WHERE user_level > ".USER_AWAITING."
          ORDER BY user_id DESC";
  $row = $site_db->query_firstrow($sql);

  $newest_user ="<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a>";
  $lang_newest_user = $lang['newest_user'];
 
  $site_template->register_vars("newest_user", $newest_user);
  unset($newest_user);

//-----------------------------------------------------


to :

Code: [Select]

//-----------------------------------------------------
// --- Newest username --------------------------------
//-----------------------------------------------------
  $sql = "SELECT user_id, user_name
          FROM ".USERS_TABLE."
          WHERE user_level > ".USER_AWAITING." OR user_level > ".GUEST."
          ORDER BY user_id DESC";
  $row = $site_db->query_firstrow($sql);

  $newest_user ="<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a>";

  $site_template->register_vars(array(
  "lang_newest_user" => $lang['newest_user']
  ));

  $site_template->register_vars("newest_user", $newest_user);
  unset($newest_user);

//-----------------------------------------------------


Now, assuming you're using the english version, in your lang/english/main.php file,

right above the : ' ?> ' tag,

add :

Code: [Select]

//-------------------------------------------------------
//--- Newest members ------------------------------------
//-------------------------------------------------------

$lang['newest_user'] = "Our newest user is: ";


Then, in your templates/<your_template>/home.html file,

add the two following tags where you want :

Code: [Select]

{if user_loggedin}{lang_newest_user}{newest_user}{endif user_loggedin}


These should clarify things. ;)


Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: how can iadd last member name ?
« Reply #4 on: June 02, 2005, 06:56:20 PM »
hi TheOracle,

your modification makes now the thing perfectly ...  :wink:
thanks for your interest.

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 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: how can iadd last member name ?
« Reply #5 on: June 03, 2005, 12:08:30 AM »
Code: [Select]
          WHERE user_level > ".USER_AWAITING." OR user_level > ".GUEST."is equal to
Code: [Select]
          WHERE user_level > ".GUEST."
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 Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: how can iadd last member name ?
« Reply #6 on: December 02, 2009, 09:35:39 AM »
hy,
i want to hide the tag {newest_user} after 5days registered days. is it possible?

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: how can iadd last member name ?
« Reply #7 on: December 02, 2009, 10:33:01 AM »
replace
Code: [Select]
          WHERE user_level > ".USER_AWAITING." OR user_level > ".GUEST."

with:
Code: [Select]
          WHERE user_level > ".GUEST." AND user_joindate > ".(time() - 432000)."
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 Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: how can iadd last member name ?
« Reply #8 on: December 02, 2009, 01:47:13 PM »
wow!  :!:
thank you very much! it works!

Offline AKIN

  • Full Member
  • ***
  • Posts: 121
    • View Profile
    • Resim
Re: how can iadd last member name ?
« Reply #9 on: December 02, 2009, 02:42:33 PM »
thanks V@no

Offline lailash

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: how can iadd last member name ?
« Reply #10 on: February 12, 2012, 09:44:05 AM »
Hallo,
wie bekomme ich die Anzeige der neusten 5 User hin?
Gruss Lailash
« Last Edit: February 12, 2012, 10:37:48 AM by lailash »

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: how can iadd last member name ?
« Reply #11 on: February 12, 2012, 11:20:08 AM »
nicht übel, und am besten in einer Box wie die "Last active users "

Danke Harald