4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: MadSci on September 14, 2007, 01:02:48 PM

Title: [MOD] Welcome to our latest member..
Post by: MadSci 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
Title: Re: one more MOD request
Post by: thunderstrike 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>";
Title: Re: one more MOD request
Post by: MadSci 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
Title: Re: one more MOD request
Post by: thunderstrike 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.
Title: Re: one more MOD request
Post by: MadSci 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
Title: Re: one more MOD request
Post by: thunderstrike 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.
Title: Re: one more MOD request
Post by: MadSci on September 16, 2007, 02:33:26 AM
can we make it like this board...for everybody..
thnx
ms
Title: Re: one more MOD request
Post by: thunderstrike on September 16, 2007, 02:49:56 AM
On this board ... ?
Where you see welcome message for everybody on this board ... ?
Title: Re: one more MOD request
Post by: MadSci on September 16, 2007, 04:24:07 AM
Ok look I want same thing for 4images ( check attachment)
ms

Title: Re: one more MOD request
Post by: thunderstrike 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. ;)
Title: Re: one more MOD request
Post by: MadSci 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
Title: Re: [MOD] Welcome to our latest member..
Post by: masterred 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
Title: Re: [MOD] Welcome to our latest member..
Post by: milanNN 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.
Title: Re: [MOD] Welcome to our latest member..
Post by: V@no 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 (http://www.4homepages.de/forum/index.php?topic=24177.0)