Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-06-2009, 02:37 AM
LoGan.M LoGan.M is offline
 
Join Date: Feb 2009
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default latest newest x members

I'm looking for a mod to do the following :

show a welcome message for the last x registered members scrolling under navbar

message simple:

Admin user name: welcome to our newest member (member user name) .............. (icon) ( next message ) and so on

Thanks in Advance
Reply With Quote
  #2  
Old 03-06-2009, 02:57 AM
Mr-Moo Mr-Moo is offline
 
Join Date: Sep 2007
Location: Chicago, IL.
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can show you how to do a single user - possibly someone could elaborate on my "single" user code.

Simply place this code within a marquee or however you are displaying your scroll bar.
PHP Code:
<phrase 1="member.php?$session[sessionurl]u=$newuserid2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase
Reply With Quote
  #3  
Old 03-06-2009, 07:36 AM
LoGan.M LoGan.M is offline
 
Join Date: Feb 2009
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Mr-Moo for your reply

i found this code in an older thread

by kiril_cvetkov

Code:
$sql=$db->query_read("SELECT username,userid FROM ".TABLE_PREFIX." user ORDER BY userid desc LIMIT 5");
while ($get = $db->fetch_array($sql))
{
$theusername =  $get['username'];
$userid = $get['userid'];
$latestmembers .= "<a href =member.php?u=$userid>$theusername</a> ";
}  
but this will give me a single line contain all the last five members , and i need it to look like this:

Quote:
message simple:

Admin user name: welcome to our newest member (member user name) .............. (icon) ( next message ) and so on
----------

other ways i found:

I don't know a lot about programming but i managed to put this code together from 2 separated mods i found, each one of them was doing half of what i wanted

can someone please tell me if this code is right ? will it work ?

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="welcomemessage" active="1">
    <title>Welcome Message</title>
    <description>Automatically Wellcome New Members</description>
    <version>1.00</version>
    <url></url>
    <versioncheckurl />
    <dependencies>
    </dependencies>
    <codes>
        <code version="1">
            <installcode><![CDATA[$db->query_write("DROP TABLE IF EXISTS welcomemsg");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "welcomemsg");
$db->query_write("CREATE TABLE " . TABLE_PREFIX . "welcomemsg
          (
  `id` int(100) NOT NULL auto_increment,
  `usergroupid` INT( 25 ) NOT NULL ,
  `userid` int(20) NOT NULL default '0',
  `name` text NOT NULL,
  `home` text NOT NULL,
  `msg` text NOT NULL,
  `dateline` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`)
          )
");
<uninstallcode><![CDATA[[$db->query_write("DROP TABLE IF EXISTS wellcommsg");
</code>
    </codes>
    <template name="welcome_Msg" templatetype="template" date="0" username="" version=""><![CDATA[
<if condition="$vboptions[welcomemsg_active]">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<thead>
<tr>
    <td class="thead" align="center">
        <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('beebi_welcomemsg')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" border="0" /></a>$vbphrase[welcomemsg]</td>
</tr>
</thead>
<tbody id="collapseobj_beebi_welcomemsg" style="$vbcollapse[collapseobj_beebi_welcomemsg]">
<tr>
    <td class="alt1">
$message_move
</td>
</tr>
</tbody>
</table>
<br />
</if>
]]></template>
    <plugins>
        <plugin active="1" executionorder="5">
            <title>Welcome Message</title>
            <hookname>register_addmember_complete</hookname>
            <phpcode><![CDATA[$fromuid=$vbulletin->options['welcom_mes_uid'];
$rating=$db->query_first("SELECT username from user where  
userid=$fromuid");
$fromuser=$rating[username];
$fromhome=$vbulletin->options[bbtitle];
$wlcommsg=$vbphrase[welcomemsg];
$wlcommsg2=$vbphrase[welcomemsg2];
$nname=$vbulletin->userinfo['username'];
$now = TIMENOW;

if ($vbulletin->options['welcom_message_onoff'])
{

$db->query_write("INSERT INTO " . TABLE_PREFIX . "welcomemsg (userid, name, home, 

msg, dateline) VALUES ('$fromuid', '$fromuser', '$fromhome', '$wlcommsg 
$nname $wlcommsg2','$now')");
}]]></phpcode>
        </plugin>
            <plugin active="1" executionorder="5">
            <title>Auto Replacment</title>
            <hookname>global_start</hookname>
            <phpcode><![CDATA[eval('$welcome_message .= "' . fetch_template('welcome_message') . '";');
$vbulletin->templatecache['navbar'] = $vbulletin->templatecache['navbar'].$vbulletin->templatecache['welcome_message'];]]></phpcode>
        </plugin>
        <plugin active="1" executionorder="5">
            <title>All Pages</title>
            <hookname>global_start</hookname>
            <phpcode><![CDATA[if (!$vbulletin->options['welcome_style'])
        {
            $welcome_bit .= "<font dir='rtl'><a href='./member.php?u=" . $welcome['userid'] . "'><img src='images/" . $vbulletin->options['welcome_pic_url'] ."' width=" . $vbulletin->options['welcome_pic_wight'] . " height=" . $vbulletin->options['welcome_pic_height'] . " border='0'></a>  <font dir='rtl' color=" . $vbulletin->options['welcome_user_color'] . ">" . $welcome['name'] . "</font>" . iif($vbulletin->options['welcome_home_enable'],"  <font dir='rtl' color=" . $vbulletin->options['welcome_home_color'] . ">" . $vbphrase['form_home'] . " " . $welcome['home'] . "</font> ") . "<font dir='rtl' color=" . $vbulletin->options['welcome_msg_color'] . "> : " . $welcome['msg'] . " </font>";
        }
        else
        {
            $welcome_bit .= "<font dir='rtl'><fieldset><legend align='right' style='background-color: #FFFFFF; border: 1px solid #000000;'> <font dir='rtl' color=" . $vbulletin->options['welcome_user_color'] . "><a href=./member.php?u=" . $welcome['userid'] . "></a>" . $welcome['name'] . "</font>" . iif($vbulletin->options['welcome_home_enable']," <font dir='rtl' color=" . $vbulletin->options['welcome_home_color'] . ">" . $vbphrase['form_home'] . " " . $welcome['home'] . "</font>") . " <font dir='rtl' color=" . $vbulletin->options['welcome_date_color'] . ">" . $welcome['date'] . " " . $welcome['time'] . "</font>   </legend><div align='right'> <font dir='rtl' color=" . $vbulletin->options['welcome_msg_color'] . ">" . $welcome['msg'] . "</font></div></fieldset><br />";
        }
}
if (!$vbulletin->options['welcome_style'])
{
    $welcome_move = "<marquee dir='ltr' style='border: " . $vbulletin->options['welcome_bord'] . "px solid " . $vbulletin->options['welcome_bord_color'] . "' onmouseover=this.stop() onmouseout=this.start() scrollAmount=" . $vbulletin->options['welcome_speed'] . " scrollDelay=60 direction=right dir=ltr width=100%>" . $welcome_bit . "</marquee>";
}
else
{
    $welcome_move = "<marquee style='border: " . $vbulletin->options['welcome_bord'] . "px solid " . $vbulletin->options['welcome_bord_color'] . "' onmouseover=this.stop() onmouseout=this.start() scrollAmount=" . $vbulletin->options['welcome_speed'] . " scrollDelay=60 direction=up width=100% height=" . $vbulletin->options['welcome_height'] . ">" . $welcome_bit . "</marquee>";
}]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
        <phrasetype name="GLOBAL" fieldname="global">
            <phrase name="new_welcome_msg" date="1208334220" username="admin" version="1.00"><![CDATA[ ^ 2Welcome^ $username ]]></phrase>
            <phrase name="welcomemsg" date="1209287847" username="admin" version="1.00"><![CDATA['some text here']]></phrase>
            <phrase name="welcomemsg2" date="1209380285" username="admin" version="1.00"><![CDATA['more text' ]]></phrase>
            <phrase name="welcommessage" date="1207515290" username="admin" version="1.00"><![CDATA['even more text']]></phrase>
        </phrasetype>
        <phrasetype name="vBulletin Settings" fieldname="vbsettings">
            <phrase name="setting_welcome_message_onoff_desc" date="1209289830" username="admin" version="1.00"><![CDATA[Press yes to Activate]]></phrase>
            <phrase name="setting_welcome_message_onoff_title" date="1209289830" username="admin" version="1.00"><![CDATA[Activate Welcome Message]]></phrase>
            <phrase name="setting_welcom_message_uid_desc" date="1209293827" username="admin" version="1.00"><![CDATA[Enter Message poster user id]]></phrase>
            <phrase name="setting_welcome_message_uid_title" date="1209293827" username="admin" version="1.00"><![CDATA[User Id]]></phrase>
            <phrase name="settinggroup_" date="1207732881" username="admin" version="1.00" />
            <phrase name="settinggroup_welcome_message" date="1209420989" username="admin" version="1.00"><![CDATA[Welcome Message Options]]></phrase>
        </phrasetype>
    </phrases>
    <options>
        <settinggroup name="welcome_Message" displayorder="241">
            <setting varname="welcome_Message_onoff" displayorder="1">
                <datatype>free</datatype>
                <optioncode>yesno</optioncode>
                <defaultvalue>0</defaultvalue>
            </setting>
            <setting varname="welcome_Message_uid" displayorder="2">
                <datatype>number</datatype>
                <defaultvalue>1</defaultvalue>
            </setting>
        </settinggroup>
    </options>
    <helptopics>
    </helptopics>
    <cronentries>
    </cronentries>
    <faqentries>
    </faqentries>
</product>
if not any help doing this mod is much appreciated , thank you
Reply With Quote
  #4  
Old 03-06-2009, 08:56 AM
Gio~Logist's Avatar
Gio~Logist Gio~Logist is offline
 
Join Date: Jun 2004
Location: San Francisco
Posts: 2,575
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try something like this

PHP Code:
$getnewestmembers $vbulletin->db->query_read("SELECT username,userid FROM ".TABLE_PREFIX." user ORDER BY userid desc LIMIT 5");
while (
$member $vbulletin->db->fetch_array($getnewestmembers))
{
    
$latestmembers .= "Welcome to our newest member, <a href='member.php?u=$member[userid]'>$member[username]</a> <br />";

Reply With Quote
  #5  
Old 03-06-2009, 02:26 PM
Mr-Moo Mr-Moo is offline
 
Join Date: Sep 2007
Location: Chicago, IL.
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, indeed that works much better since it pulls a query from the latest 5.

Thank you Gio~Logist,
Everything looks good with Gio~Logist's code, however if you are looking to have it in a marquee, make sure you take out the </ br> and replace it with a "-" or something on those lines. The </ br> will make it drop a line down.
Reply With Quote
  #6  
Old 03-07-2009, 09:20 PM
LoGan.M LoGan.M is offline
 
Join Date: Feb 2009
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great, thank you Geo~Logist and Mr-Moo for your help :up:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:32 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04054 seconds
  • Memory Usage 2,243KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete