Go Back   vb.org Archive > vBulletin 5 Connect Discussion > vB5 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-30-2014, 11:49 AM
Ivan Beser Ivan Beser is offline
 
Join Date: Feb 2014
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Latest Members?

Hello,

is there any possibility to show the latest members at vB5?

... could make a php module with a query of the latest (eg 5) members.
...if it is safe enough?

...or could do it by a widget/ mod.
Have no idea how to do that. :-(

Could anybody help me with one of this?
Thanks in advance.
Reply With Quote
  #2  
Old 09-01-2014, 02:27 AM
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Location: at Home...
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ivan Beser View Post
Could anybody help me with one of this?
Yes. What do you actually need help with? How much PHP do you know?
Reply With Quote
  #3  
Old 09-01-2014, 07:15 AM
Ivan Beser Ivan Beser is offline
 
Join Date: Feb 2014
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dead Eddie View Post
Yes. What do you actually need help with? How much PHP do you know?
Hello Dead Eddie,

thank you for your quick reply.
My PHP-Knowlege is not that good. Reading and edit a existing code is not a big deal, but write one by my self is a little to much for me.

I looked into the member.php and widget_memberslist and try to get a code sniped to edit it into order by desc - limit 5 or something like that.
Unfortunately I didn't find anything that helped me.

A big question for me is also if it is safe to make a php module in Site Edit with a DB query inside or rather how xould I use the db query within vB.

So I think I need a lot of help

Edit: Find a example at vBulletin.com that helps me a little...

http://www.vbulletin.com/forum/forum...-or-php-widget

Hopfully vB5 is working like this too... But it would be fine to have a latest-member-module to choose in "Edit site".

Try to make a php-module and call for help if I need it :-)

--------------- Added [DATE]1409605624[/DATE] at [TIME]1409605624[/TIME] ---------------

Ok, this is my idea or some code I edit from the Mod "Member Liste for VB5" (Thanks to the Developer wdwms)

But it shows nothing so I need your help!

PHP Code:
<?
$max_results = 5;
//*** Display for Logged in Users only
//*** Set to 0 if you want the memberlist to only be shown to those users that are logged in
$showto_loggedout = 0;
//*** Check if user is logged in
$vbsession = $HTTP_COOKIE_VARS[bbsessionhash];
$query = vB::$db->query_first("Select loggedin from ".$vb_prefix."session where sessionhash = '$vbsession'");
$result2=mysql_db_query("$vb_table", "$query");
$loggedin=mysql_result($result2,0,"loggedin");
?>
<style> <!--
.dbhover {border: 1px solid #b4b4b4 !important;}
.dbhover:hover { background-color: #E5E7E8; }
--> </style>
<? 
//*** //$total_results = mysql_num_rows($result); Anzahl User gesamt
$num=mysql_numrows($result2);
$total_results=mysql_numrows($result2);
//*** Falls eingeloggt oder auch nicht registrierten Nutzern zeigen
if ($loggedin || $showto_loggedout)
{
$query ="Select * from ".$vb_prefix."user order by userid desc LIMIT $from, $max_results";
    $result=mysql_db_query("$vb_table", "$query");
    $num=mysql_numrows($result);
$i=0;
while ($i < $num) {
    $username=mysql_result($result,$i,"username");
    $vbid=mysql_result($result,$i,"userid");
    $joindate=mysql_result($result,$i,"joindate");
    $posts=mysql_result($result,$i,"posts");    
?>    
<tr bgcolor="#F4F4F4" class=dbhover>
    <td align="center" class=dbhover>
        <img src=<? echo $vb_url; ?>/core/image.php?userid=<? echo $vbid;?> width=50>
    </td>
    <td align="left" class=dbhover>
        <a href="<? echo $vb_url; ?>/member/<? echo $vbid; ?>-<?echo $username; ?>"><?echo $username; ?></a>
        <br><font size=1>(<? echo $usertitle; ?>)</td> 
    </td>
    <td valign=middle align="center" class=dbhover>
        <? echo date("m-d-y",$joindate); ?>
    </td> 
    <td valign=middle align="center" class=dbhover>
        <? echo $posts; ?>
    </td> 
    </tr>
    <?
    ++$i;
}
}
else { ?>
<ul class="notices"><li class="notice restore" data-notice-id="1" data-notice-persistent="1">
        <body bgcolor="white"><center>

        <b><font style="color: red; font-weight: bold; font-size: 14px;">
        Du musst eingeloggt sein um die neuesten Nutzer sehen zu k?nnen.</font></b>
        </li>
        </ul>    
    
    
    <?

?>

Thanks a lot!!!
Reply With Quote
  #4  
Old 09-03-2014, 04:24 AM
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Location: at Home...
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Um...yikes. No. Won't help debug this...I appreciate my sanity too much...and this is a mess.

I'll put something together. Won't be tomorrow, Thursday at the earliest. You're on a later version of vBulletin, I assume (hope?).
Reply With Quote
  #5  
Old 09-04-2014, 10:50 AM
Ivan Beser Ivan Beser is offline
 
Join Date: Feb 2014
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

the Forum runs on VB 5 if you mean it with you assume Iam on a later version of vBulletin?!

That would be great!
Reply With Quote
  #6  
Old 09-09-2014, 12:23 AM
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Location: at Home...
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ivan Beser View Post
Hi,

the Forum runs on VB 5 if you mean it with you assume Iam on a later version of vBulletin?!

That would be great!
5.1.0, .2, or .3?

I've attached an addon that creates the new widget type. It depends on having the memberlist API, which was added sometime in vBulletin 5's later life.

(Sorry about the template name. By the time I noticed it, it was too late)
Attached Files
File Type: xml product_asp_latest_user_widget.xml (3.9 KB, 87 views)
Reply With Quote
2 благодарности(ей) от:
Ivan Beser, tbworld
  #7  
Old 09-10-2014, 08:57 AM
Ivan Beser Ivan Beser is offline
 
Join Date: Feb 2014
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much!!!
That's amazing! I run 5.1.3 now and it works fine!

Is there any way to buy you a beer? :up:
Reply With Quote
  #8  
Old 09-10-2014, 11:17 AM
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Location: at Home...
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad it's working for you.
Reply With Quote
  #9  
Old 09-30-2014, 09:15 AM
Ivan Beser Ivan Beser is offline
 
Join Date: Feb 2014
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dead Eddie View Post
Glad it's working for you.
Have a related problem when I try to edit and use your code.
I want to display all users where was online the latest 24 hours.
How could I set the "TIMENOW - $userinfo[lastvisit] < 86400" in your code as a "where"-value to the array?
Could you help me with that?
Reply With Quote
  #10  
Old 09-30-2014, 09:38 PM
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Location: at Home...
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ivan Beser View Post
Have a related problem when I try to edit and use your code.
I want to display all users where was online the latest 24 hours.
How could I set the "TIMENOW - $userinfo[lastvisit] < 86400" in your code as a "where"-value to the array?
Could you help me with that?
The widget works with the established API & query for memberlist.

There's nothing in that code to accept a "where" SQL clause.

You'd have to change the backend code a bit to accept it. Can't do it from the template code.
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 11:15 PM.


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.07460 seconds
  • Memory Usage 2,289KB
  • Queries Executed 12 (?)
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
  • (1)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete