php forum
php mysql forum
php mysql smarty
 
Topic Options
#209831 - 04/09/01 03:43 AM Any hack for: "Welcome to our new user...
santana Offline
Member

Registered: 09/26/00
Posts: 229
Loc: Asia
Anyone can develop hack for the main page which displays something like:<br />"Welcome to our newest member: username."<br />"Total post:###"<br /><br />Any helps will be appreciate it.<br /><br />-santanablank-
_________________________
...... x ......
Using UBBt 6.4.2 + Digg Ajax Mod, Trust Ajax Mod, Captcha Regristation & Login mod, Checkusername Ajax mode.

Top
#209832 - 04/09/01 04:41 PM Re: Any hack for: "Welcome to our new user... [Re: often]
The Team Offline
Moderator

Registered: 08/11/00
Posts: 182
Loc: yes
Cute idea. I think you'd want to add something like this:<br /><br /><br />// show last username<br /> if ($config['showreg']) {<br /> $sth = $dbh->do_query("select U_Username from w3t_Users order by U_Number DESC limit 1");<br /> $lastUser = $dbh -> fetch_array($sth);<br /> $lastUserText = "Welcome to our newest member: $lastUser<BR>";<br /> $dbh -> finish_sth($sth);<br /> }<br /><br /><br />Then right above where he prints $showreg you add $lastUserText.<br /><br />Let me know if it works, maybe I'll use it on my site. []/w3timages/icons/wink.gif[/]<br /><br />-F<br /> <br /><br />

Top
#209833 - 04/09/01 10:59 PM Re: Any hack for: "Welcome to our new user... [Re: Anonymous]
santana Offline
Member

Registered: 09/26/00
Posts: 229
Loc: Asia
fmann, thanks, but it doesn't work.<br />It says: Welcome to our newest member: array<br /><br />Any idea why?<br /><br />-santanablank-
_________________________
...... x ......
Using UBBt 6.4.2 + Digg Ajax Mod, Trust Ajax Mod, Captcha Regristation & Login mod, Checkusername Ajax mode.

Top
#209834 - 04/10/01 12:26 AM Re: Any hack for: "Welcome to our new user... [Re: often]
The Team Offline
Moderator

Registered: 08/11/00
Posts: 182
Loc: yes
Probably beause the code has a bug in it.<br /><pre><br />// show last username<br />if ($config['showreg']) {<br />$sth = $dbh->do_query("select U_Username from w3t_Users order by U_Number DESC limit 1");<br />list($lastUser) = $dbh -> fetch_array($sth);<br />$lastUserText = "Welcome to our newest member: $lastUser<BR>";<br />$dbh -> finish_sth($sth);<br />}<br /></pre><br /><br />Should do the trick... But I didn't test it out. That's cause fetch_array() returns an array. And when you try to print out an array and not a member in the array PHP is smart and prints "array" to help you debug..<br /><br />If that code up there doesn't work then this should.<br /><pre><br />// show last username<br />if ($config['showreg']) {<br />$sth = $dbh->do_query("select U_Username from w3t_Users order by U_Number DESC limit 1");<br />$lastUser = $dbh -> fetch_array($sth);<br />$lastUserText = "Welcome to our newest member: $lastUser[0]<BR>";<br />$dbh -> finish_sth($sth);<br />}<br /></pre><br /><br />If not then I use the excuse that I didn't really take a close look at it and I'm sleep deprived. And that I'm assuming that fetch_array() returns an array based on the fact that it printed the word "array".<br /><br />Doug<br />http://www.netherworldrpg.net

Top
#209835 - 04/10/01 03:47 AM Re: Any hack for: "Welcome to our new user... [Re: Anonymous]
santana Offline
Member

Registered: 09/26/00
Posts: 229
Loc: Asia
Doug, that should do the trick!<br />Well done! It works just fine. []/w3timages/icons/smile.gif[/]<br /><br />thanks<br /><br />-santanablank-
_________________________
...... x ......
Using UBBt 6.4.2 + Digg Ajax Mod, Trust Ajax Mod, Captcha Regristation & Login mod, Checkusername Ajax mode.

Top
#209836 - 04/10/01 06:04 PM Re: Any hack for: "Welcome to our new user... [Re: Anonymous]
Brewskie Offline
Enthusiast

Registered: 01/19/01
Posts: 410
Loc: NC
Woukd this work for the Perl version too ya think?<br /><br /><pre>Brew<br />CustomShowCars.com<br />OldHouseForums.net<br />PoliticalForums.net<br /></pre><p>
_________________________
Brew
CustomShowCars.com
OldHouseForums.com
PoliticalForums.net
pcgnetworks.com
ut2003news.com
rtcwnews.com
bf1942news.com
nolf2news.com

Top
#209837 - 04/11/01 10:55 AM Re: Any hack for: "Welcome to our new user... [Re: Anonymous]
caymuc Offline
Enthusiast

Registered: 01/17/01
Posts: 449
I installed it into wwwthreads.php and categories.php<br /><br /><br /><br />I got this variant of your code working best:<br /><br />// HACK: show last username<br />if ($config['showreg']) {<br /> $sth = $dbh->do_query("SELECT U_Username FROM w3t_Users ORDER BY U_Number DESC LIMIT 1");<br /> $lastUser = $dbh -> fetch_array($sth);<br /> $showreg = "$showreg<br />Welcome to our newest member: $lastUser[0]";<br /> $dbh -> finish_sth($sth);<br />}<br />//end hack<br /><br /><br />My version should be put in right after that chunk of code:<br /><br />// --------------------------------------------------------------------------<br />// Let's see how many total registered users there are but only if we want to<br />// display this information<br /> if ($config['showreg']) {<br /> $sth = $dbh->do_query("SELECT COUNT(*) FROM w3t_Users");<br /> $registered = $dbh -> fetch_array($sth);<br /> $showreg = "$registered[0] $lang[REGED_USERS]";<br /> $dbh -> finish_sth($sth);<br /> }<br /><br /><br />It can be fine tuned by replacing the text strings with variables from the language file...<br /><br />Carl<br /><br />----------<br />http://www.colour-ize.de/forum (test entry: user: 'test' pw: 'test')
_________________________
Carl
Colour-Ize-Forums (test entry: user: 'test' pw: 'test2')

Top
#209838 - 04/11/01 12:04 PM Re: Any hack for: "Welcome to our new user... [Re: rodrigo1]
The Team Offline
Moderator

Registered: 08/11/00
Posts: 182
Loc: yes
That's not the proper way to concatenate strings in PHP... while that works because of the structure of the langauge... if you run Zend Optimizer that's bad syntax because that code can't be optimized. Proper concatenation is $showreg = $showreg . "Text here";<br /><br /><br /><br />Doug<br />http://www.netherworldrpg.net

Top
#209839 - 04/11/01 12:05 PM Re: Any hack for: "Welcome to our new user... [Re: djtech2k]
The Team Offline
Moderator

Registered: 08/11/00
Posts: 182
Loc: yes
I haven't run the Perl version of W3T for a long time... but I'll download the Perl version tonight and I'll look at it and try and come up with the code for the Perl version.<br /><br /><br />Doug<br />http://www.netherworldrpg.net

Top
#209840 - 04/11/01 12:24 PM Re: Any hack for: "Welcome to our new user... [Re: Anonymous]
Brewskie Offline
Enthusiast

Registered: 01/19/01
Posts: 410
Loc: NC
<blockquote><font size=1>In reply to:</font><hr><p>I haven't run the Perl version of W3T for a long time... but I'll download the Perl version tonight and I'll look at it and try and come up with the code for the Perl version.<p><hr></blockquote><p><br />That would be great Doug!<br /><br />Thanx!<br /><br /><pre>Brew<br />CustomShowCars.com<br />OldHouseForums.net<br />PoliticalForums.net<br /></pre><p>
_________________________
Brew
CustomShowCars.com
OldHouseForums.com
PoliticalForums.net
pcgnetworks.com
ut2003news.com
rtcwnews.com
bf1942news.com
nolf2news.com

Top
#209841 - 04/11/01 12:24 PM Re: Any hack for: "Welcome to our new user... [Re: Anonymous]
caymuc Offline
Enthusiast

Registered: 01/17/01
Posts: 449
Cool. Good to know. I put that in right away in my code. Thanks... Looks like we are finally getting there :)<br /><br />Carl<br /><br />----------<br />http://www.colour-ize.de/forum (test entry: user: 'test' pw: 'test')
_________________________
Carl
Colour-Ize-Forums (test entry: user: 'test' pw: 'test2')

Top
#209842 - 07/19/01 11:10 PM here is the exact code for all of us newbies! [Re: often]
amity Offline
Newbie

Registered: 08/08/00
Posts: 18
// HACK: show last username<br />if ($config['showreg']) {<br />$sth = $dbh-&gt;do_query("SELECT U_Username FROM w3t_Users ORDER BY U_Number DESC LIMIT 1");<br />$lastUser = $dbh -&gt; fetch_array($sth);<br />$showreg = $showreg . "Welcome to our newest mama:$lastUser[0]";<br />$dbh -&gt; finish_sth($sth);<br /> }<br /> //end hack<br /><br /><br /> look into your categories.php and your wwwthreads.php files- you will find this code:<br /><br /> // --------------------------------------------------------------------------<br /> // Let's see how many total registered users there are but only if we want to<br /> // display this information<br /> if ($config['showreg']) {<br /> $sth = $dbh-&gt;do_query("SELECT COUNT(*) FROM w3t_Users");<br /> $registered = $dbh -&gt; fetch_array($sth);<br /> $showreg = "$registered[0] $lang[REGED_USERS]";<br /> $dbh -&gt; finish_sth($sth);<br /> }<br /><br />add the hack right beneath this code (a space in between is ok!)<br /><br />i know how hard it is to get the feel for hacks and such- like the idea but scared to mess up your script! . [smile] hope this helps someone!<br /><br />just seeing if this works...<br /><br />[]/testimages/icons/wink.gif[/]
_________________________
just seeing if this works...

<img src="/threads/php/images/graemlins/wink.gif" alt="" />

Top
#209843 - 07/21/01 10:51 AM Re: here is the exact code for all of us newbies! [Re: M2C4U]
MrFrog Offline
User

Registered: 10/03/00
Posts: 37
Ok This is a cool idea and works great (when you type the codeing in correctly).<br /><br />Thanks!<br /><br /><P ID="edit"><FONT class="small"><EM>Edited by MrFrog on 07/21/01 11:55 AM.</EM></FONT></P>

Top
#209844 - 07/21/01 09:48 PM glad it works for you! of course you need to [Re: sugarpony]
amity Offline
Newbie

Registered: 08/08/00
Posts: 18
um. of course, you would want to substitute the word 'user' in your code for 'mama' in mine. []/testimages/icons/smile.gif[/]<br /><br />amity<br /><br />just seeing if this works...<br /><br />[]/testimages/icons/wink.gif[/]
_________________________
just seeing if this works...

<img src="/threads/php/images/graemlins/wink.gif" alt="" />

Top
#209845 - 07/21/01 11:29 PM Re: glad it works for you! of course you need to [Re: M2C4U]
MrFrog Offline
User

Registered: 10/03/00
Posts: 37
LOL yes I did notice that the fist time it poped up and went back and changed it.<br /><br />

Top


Who's Online
0 registered (), 24 Guests and 15 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Spell Check [beta]
by Bill B
Today at 09:16 PM
PhotoPost BB Code Popup
by AllenAyres
Today at 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
Today at 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
Today at 09:33 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
Active Topics.
by AllenAyres
11/11/08 02:13 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
David DelMonte, nick1, Begbie, cenk, MATTO
13363 Registered Users
Top Posters
AllenAyres 25452
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks