Author Topic: [MOD-Request]New Registered User  (Read 26640 times)

0 Members and 1 Guest are viewing this topic.

Offline ksk

  • Pre-Newbie
  • Posts: 7
    • View Profile
[MOD-Request]New Registered User
« on: March 31, 2003, 04:57:52 AM »
hello, how to make it display in main web
display, welcome to our new registered user, nickname, nickname, and nickname??

thank you for reply !!  :o

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-Request]New Registered User
« Reply #1 on: March 31, 2003, 05:17:23 AM »
Open /includes/stats.php
Add at the end, just before closing ?>
Code: [Select]
//-----------------------------------------------------
//--- New Member --------------------------------------
//-----------------------------------------------------
$sql = "SELECT *
        FROM ".USERS_TABLE."
        WHERE ".get_user_table_field("", "user_id")." <> ".GUEST."
        ORDER by ".get_user_table_field("", "user_joindate")." DESC";
$row = $site_db->query_firstrow($sql);

$new_member = "Welcome to our new registered user, ".(($row[$user_table_fields['user_id']]) ? " <a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\"><B>".$row[$user_table_fields['user_name']]."</B></a>\n" : "<B>".$row[$user_table_fields['user_name']]."</B>");
$site_template->register_vars("new_member", $new_member);
unset($new_member);

Then, open /templates/<yourtemplate>/whos_online.html and add this tag: {new_member}
« Last Edit: December 13, 2005, 11:37:13 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 ksk

  • Pre-Newbie
  • Posts: 7
    • View Profile
hey vano
« Reply #2 on: March 31, 2003, 05:46:26 AM »
thanks man,
me, always saw ur reply all the time
u are the helper ! :)

Offline Xwall

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.xwall.tk
Problem
« Reply #3 on: March 31, 2003, 11:01:39 AM »
V@no but this is for a new pre-registered user, if it is possible to show only new confirmed-registered user.  :?

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: Problem
« Reply #4 on: March 31, 2003, 01:29:31 PM »
Quote from: Xwall
V@no but this is for a new pre-registered user, if it is possible to show only new confirmed-registered user.  :?
good pint! ;)
in my code change:
Code: [Select]
          WHERE ".get_user_table_field("", "user_id")." <> ".GUEST."to this:
Code: [Select]
          WHERE ".get_user_table_field("", "user_level")." > ".USER_AWAITING."
« Last Edit: December 13, 2005, 11:38:24 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 LoOpP

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
[MOD-Request]New Registered User
« Reply #5 on: March 31, 2003, 02:08:26 PM »
my stats.php is in the admin folder!

wrong?

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-Request]New Registered User
« Reply #6 on: March 31, 2003, 02:13:27 PM »
Quote from: LoOpP
my stats.php is in the admin folder!

wrong?

yes, wrong ;)
it should be in /includes/ folder also.
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 Xwall

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.xwall.tk
[MOD-Request]New Registered User
« Reply #7 on: March 31, 2003, 04:17:13 PM »
Perfect, Thanks V@no  :D

Offline fanncy pants

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • http://www.backshots.us
Don't see 'stats.php' in includes
« Reply #8 on: May 06, 2003, 07:28:27 PM »
Quote from: V@no
Quote from: LoOpP
my stats.php is in the admin folder!

wrong?

yes, wrong ;)
it should be in /includes/ folder also.


 :?:  I use version 1.7 and I don't see "stats.php" in the includes folder either.  Is it alright if I just copied the file from the admin folder to the includes folder?

Fanncy Pants!

[/color]

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: Don't see 'stats.php' in includes
« Reply #9 on: May 06, 2003, 07:36:43 PM »
Quote from: fanncy pants
I use version 1.7 and I don't see "stats.php" in the includes folder either.  Is it alright if I just copied the file from the admin folder to the includes folder?

no, u cant. Just redownload 4images package from this site. ;)
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 fanncy pants

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • http://www.backshots.us
Thanks Vano!
« Reply #10 on: May 06, 2003, 08:03:50 PM »
Thank you.  I'll do that!  :D

Fanncy Pants!

[/color]

Offline fanncy pants

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • http://www.backshots.us
?
« Reply #11 on: May 06, 2003, 08:18:02 PM »
Hi V@no,

I re-downloaded the 4images zip, looked in the includes folder, and still no sign of 'stats.php' there.

Fanncy Pants!

[/color]

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-Request]New Registered User
« Reply #12 on: May 06, 2003, 08:24:33 PM »
wow! u are right! I'm sorry. Dont remmber if I did it myself or what... :?
well, ok, then, here is little changed version of what I remmber was by default (?)
create stats.php in /includes/ folder with this code:
Code: [Select]
<?php

//-----------------------------------------------------
//--- Show number of Users ----------------------------
//-----------------------------------------------------
 
  $sql "SELECT COUNT(*) as users
          FROM "
.USERS_TABLE."
          WHERE user_id <> "
.GUEST;
 
 $row $site_db->query_firstrow($sql);
 
 $total_users = ($row['users']) ? " <a href=\"".$site_sess->url(ROOT_PATH."memberlist.php")."\"><B>".$row['users']."</B></a>\n" "<B> ".$row['users']."</B>";

//-----------------------------------------------------
//--- Hits --------------------------------------------
//-----------------------------------------------------
 
  $sql "SELECT SUM(image_hits) AS sum
          FROM "
.IMAGES_TABLE;
 
 $row $site_db->query_firstrow($sql);

 
 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 
 $total_hits "<B> ".$row['sum']."</B>\n";

//-----------------------------------------------------
//--- Votes -------------------------------------------
//-----------------------------------------------------
 
  $sql "SELECT SUM(image_votes) AS sum
          FROM "
.IMAGES_TABLE;
 
 $row $site_db->query_firstrow($sql);

 
 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 
 $total_votes "<B> ".$row['sum']."</B>\n";

//-----------------------------------------------------
//--- Downloads ---------------------------------------
//-----------------------------------------------------
 
  $sql "SELECT SUM(image_downloads) AS sum
          FROM "
.IMAGES_TABLE;
 
 $row $site_db->query_firstrow($sql);

 
 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 
 $total_downloads "<B> ".$row['sum']."</B>\n";

//-----------------------------------------------------
//--- Comments ----------------------------------------
//-----------------------------------------------------
 
  $sql "SELECT SUM(image_comments) AS sum
          FROM "
.IMAGES_TABLE;
 
 $row $site_db->query_firstrow($sql);

 
 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 
 $total_comments = ($row['sum']) ? " <a href=\"".$site_sess->url(ROOT_PATH."example.php")."\"><B>".$row['sum']."</B></a>\n" "<B> ".$row['sum']."</B>";

//-----------------------------------------------------
//--- New Member --------------------------------------
//-----------------------------------------------------
 
  $sql "SELECT user_id, user_name
          FROM "
.USERS_TABLE."
          WHERE user_level > "
.USER_AWAITING."
          ORDER by user_joindate DESC"
;
 
 $row $site_db->query_firstrow($sql);
 
 $new_member = ($row['user_id']) ? " <a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><B>".$row['user_name']."</B></a>\n" "<B>".$row['user_name']."</B>";

 
 $site_template->register_vars(array(
 
  "lang_new_member" => $lang['new_member_welcome'],
 
  "new_member" => $new_member,
 
  "lang_total_users" => $lang['users'],
 
  "total_users" => $total_users,
 
  "lang_total_hits" => $lang['total_hits'],
 
  "total_hits" => $total_hits,
 
  "lang_total_votes" => $lang['total_votes'],
 
  "total_votes" => $total_votes,
 
  "lang_total_downloads" => $lang['total_downloads'],
 
  "total_downloads" => $total_downloads,
 
  "lang_total_comments" => $lang['total_comments'],
 
  "total_comments" => $total_comments
  
));
unset(
$new_member);
unset(
$total_comments);
unset(
$total_downloads);
unset(
$total_votes);
unset(
$total_hits);
unset(
$total_users);
?>

now, in index.php after: $user_access = get_permission();
add this line:include(ROOT_PATH.'includes/stats.php');

now, u can add in your statistic template {...} tags.
for example, look at the end of that code:
          "lang_new_member"            => $lang['new_member_welcome'],
           "new_member"                  => $new_member,


u can use the words in red in those {...} tags (i.e. {lang_new_member})
u might need add some $lang['<words_as_in_green>'] = "text"; in /lang/<yourlanguage>/main.php
« Last Edit: March 22, 2006, 02:23:09 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 fanncy pants

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • http://www.backshots.us
Weee!
« Reply #13 on: May 06, 2003, 08:35:14 PM »
Thanks V@ano!  :D

Fanncy Pants!

[/color]

Offline toto1

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.gifanimer.com
[MOD-Request]New Registered User
« Reply #14 on: May 07, 2003, 12:20:15 PM »
does hello veno y' have an error?  it is what the file example.php:  
Code: [Select]
$$total_comments = ($$row['sum ' ])?  "< href=\"".$site_sess->url(ROOT_PATH."example.php")."\"><B>".$row[' sum' ]."</B></a>\n has":  

and which code must one add you in the templates in order to post the news member thank you

sorry for my english is french[/code]