Author Topic: [MOD] Welcome to our latest member..  (Read 17028 times)

0 Members and 1 Guest are viewing this topic.

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
[MOD] Welcome to our latest member..
« on: September 14, 2007, 01:02:48 PM »
1. on the front page to have: Welcome to our newest member {user_name} of the one who just registered.  :lol:

ms
« Last Edit: September 16, 2007, 06:25:22 AM by MadSci »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: one more MOD request
« Reply #1 on: September 14, 2007, 01:18:13 PM »
This might help:

http://www.4homepages.de/forum/index.php?topic=10629.0

or

In lang/english/main.php file,

find:

Quote
$lang['lang_loggedin_msg'] = "Logged in as: <b>{loggedin_user_name}</b>";

replace:

Code: [Select]
$lang['lang_loggedin_msg'] = "Welcome: <b>{loggedin_user_name}</b>";
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: one more MOD request
« Reply #2 on: September 14, 2007, 03:23:48 PM »
Humm that will welcome every user who is logged in..what I meant was:

1.user registers
2.Gets an email with the activation link
3. Clicks on the link
4. msg shows on the front page:
"Welcome to our newest member:" and then show the name of the person who registered last.

ms

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: one more MOD request
« Reply #3 on: September 14, 2007, 10:13:06 PM »
Quote
1.user registers
2.Gets an email with the activation link
3. Clicks on the link

This is 4images core. You can configure in ACP - > setting page for register confirm by email.

Quote
4. msg shows on the front page:
"Welcome to our newest member:" and then show the name of the person who registered last.

I like. :)

// Step 1

In register.php file,

find:

Quote
$site_email->set_body("activation_success", $config['language_dir']);
        $site_email->send_email();
      }
    }
  }

add after:

Code: [Select]
$welcome_activation_msg = str_replace(array("{welcome_user_name}", "{site_name}"), array(format_text(trim($row[$user_table_fields['user_name']]), 2), format_text($config['site_name'], 2)), $lang['welcome_activation_message']);
$welcome_activation_template = $site_template->parse_template("member_activation_content"); 
$site_template->register_vars("welcome_activation_msg", trim($welcome_activation_msg));

find:

Quote
"msg" => $msg,

add after:

Code: [Select]
"welcome_activation_template" => trim($welcome_activation_template),

// Step 2

In lang/english/main.php file,

add top of ?>:

Code: [Select]
$lang['welcome_activation_message'] = "Dear {welcome_user_name},<br /><br />we would like to welcome you to our gallery: <b>{site_name}</b>.";

// Step 3

In templates/your_template folder, create file: member_activation_content.html .

Use: {if welcome_activation_msg}{welcome_activation_msg}{endif welcome_activation_msg} .

// Step 4

In templates/your_template/member.html file,

use: {if welcome_activation_template}{welcome_activation_template}{endif welcome_activation_template} where you want in file.
« Last Edit: September 14, 2007, 11:28:40 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: one more MOD request
« Reply #4 on: September 15, 2007, 10:52:03 PM »
so the welcome msg will be seen by evrybody on the fron page right ...not only by the person who just registered...?

look at the upper right hand corner of this board..there is a windown that says "KEY STATS" and then under Total Members and then Latest member: ...some name"

ms

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: one more MOD request
« Reply #5 on: September 16, 2007, 02:00:20 AM »
Quote
so the welcome msg will be seen by evrybody on the fron page right ...not only by the person who just registered...?

This MOD good for all USER_AWAITING level to USER (activate account). No other.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: one more MOD request
« Reply #6 on: September 16, 2007, 02:33:26 AM »
can we make it like this board...for everybody..
thnx
ms

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: one more MOD request
« Reply #7 on: September 16, 2007, 02:49:56 AM »
On this board ... ?
Where you see welcome message for everybody on this board ... ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: one more MOD request
« Reply #8 on: September 16, 2007, 04:24:07 AM »
Ok look I want same thing for 4images ( check attachment)
ms


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: one more MOD request
« Reply #9 on: September 16, 2007, 05:49:07 AM »
Ahh ! good. Now tawk my language. ;)

// Step 1

In includes/functions.php file,

add top ?>:

Code: [Select]
function show_last_registered_users() {
    global $site_db, $lang, $site_sess, $site_template, $additional_user_fields, $user_table_fields;
   
    $additional_sql = "";   
    if (isset($additional_user_fields) && is_array($additional_user_fields) && !empty($additional_user_fields)) {
        foreach ($additional_user_fields as $key => $val) {
            $additional_sql .= ", " . $key;           
        }
    }
   
    $sql = "
   
    SELECT " . get_user_table_field("", "user_id") . get_user_table_field(", ", "user_name") . $additional_sql . "
    FROM " . USERS_TABLE . "
    WHERE " . get_user_table_field("", "user_level") . " >= '" . USER . "'
    ORDER BY " . get_user_table_field("", "user_joindate") . " DESC
   
    ";
   
    $row = $site_db->query_firstrow($sql);
    $last_user_id = (isset($row[$user_table_fields['user_id']])) ? $row[$user_table_fields['user_id']] : "";
    $last_user_name = (isset($row[$user_table_fields['user_name']])) ? $row[$user_table_fields['user_name']] : "";
   
    $site_template->register_vars("show_last_user_name", str_replace(array("{last_user_name}", "{last_user_name_link}"), array(format_text(trim($last_user_name), 2), $site_sess->url(ROOT_PATH . "member.php?action=showprofile&" . URL_USER_ID . "=" . (int)$last_user_id)), $lang['last_user_name']));
    $last_user_name_template = $site_template->parse_template("last_user_name_registered");
    $site_template->register_vars("last_user_name_template", trim($last_user_name_template));
}

// Step 2

In lang/english/main.php file,

add top ?>:

Code: [Select]
$lang['last_user_name'] = "Last member: <a href=\"{last_user_name_link}\" class=\"link\" /><b>{last_user_name}</b></a>";

// Step 3

In includes/page_header.php file,

find:

Quote
//-----------------------------------------------------
//--- Random Image ------------------------------------
//-----------------------------------------------------

add before:

Code: [Select]
//-----------------------------------------------------
//--- Show last registered user -----------------------
//-----------------------------------------------------
if (function_exists('show_last_registered_users')) {
    show_last_registered_users();
}

// Step 4

In templates/your_template, create file: last_user_name_registered.html .

Add:

Code: [Select]
{if show_last_user_name}{show_last_user_name}{endif show_last_user_name}

// Step 5

Add any HTML you want (1 template of choice) have {header} to {footer} - this tag:

Code: [Select]
{if last_user_name_template}{last_user_name_template}{endif last_user_name_template}

Should work. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: one more MOD request
« Reply #10 on: September 16, 2007, 06:00:10 AM »
thank you thank you thats is cool...

back to the editor..

ms
I have another q. but will open new post.

ms

UPDATE:
========
Works Like a charm thank you one more time
« Last Edit: September 16, 2007, 06:22:27 AM by MadSci »

Offline masterred

  • Sr. Member
  • ****
  • Posts: 494
    • View Profile
Re: [MOD] Welcome to our latest member..
« Reply #11 on: February 08, 2008, 03:40:31 AM »
Quote
1.user registers
2.Gets an email with the activation link
3. Clicks on the link

This is 4images core. You can configure in ACP - > setting page for register confirm by email.

Quote
4. msg shows on the front page:
"Welcome to our newest member:" and then show the name of the person who registered last.

I like. :)

// Step 1

In register.php file,

find:

Quote
$site_email->set_body("activation_success", $config['language_dir']);
        $site_email->send_email();
      }
    }
  }

add after:

Code: [Select]
$welcome_activation_msg = str_replace(array("{welcome_user_name}", "{site_name}"), array(format_text(trim($row[$user_table_fields['user_name']]), 2), format_text($config['site_name'], 2)), $lang['welcome_activation_message']);
$welcome_activation_template = $site_template->parse_template("member_activation_content"); 
$site_template->register_vars("welcome_activation_msg", trim($welcome_activation_msg));

find:

Quote
"msg" => $msg,

add after:

Code: [Select]
"welcome_activation_template" => trim($welcome_activation_template),

// Step 2

In lang/english/main.php file,

add top of ?>:

Code: [Select]
$lang['welcome_activation_message'] = "Dear {welcome_user_name},<br /><br />we would like to welcome you to our gallery: <b>{site_name}</b>.";

// Step 3

In templates/your_template folder, create file: member_activation_content.html .

Use: {if welcome_activation_msg}{welcome_activation_msg}{endif welcome_activation_msg} .

// Step 4

In templates/your_template/member.html file,

use: {if welcome_activation_template}{welcome_activation_template}{endif welcome_activation_template} where you want in file.

dont show nothing message welcome in member

create template

member_activation_content.html

modify lang/main.php

Code: [Select]
$lang['welcome_activation_message'] = "Dear {welcome_user_name},<br /><br />we would like to welcome you to our gallery: <b>{site_name}</b>.";
insert in member this

Quote
<table border="0" cellpadding="0" cellspacing="0" width="100%">
   <tr>
      <td class="row2" valign="top">{if welcome_activation_template}{welcome_activation_template}{endif welcome_activation_template}</td>
   </tr>
</table>
Quote

other step register change

thanks
Apache/2.2.21 (Win32)
PHP/5.3.5
Mysql Version: 5.5.19
4images Version: 1.7.?



Offline milanNN

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • http://www.planesphotos.net
Re: [MOD] Welcome to our latest member..
« Reply #12 on: January 09, 2011, 09:14:04 PM »
I see only LAST MEMBER without nickname and error:
An unexpected error occured. Please try again later.

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: [MOD] Welcome to our latest member..
« Reply #13 on: January 09, 2011, 10:34:10 PM »
please follow this topic to get exact error message:
An unexpected error occured. Please try again later
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)