Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 04-30-2004, 08:02 PM
Curll's Avatar
Curll Curll is offline
 
Join Date: Apr 2003
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Calander on non-VB pages

I'm looking for a hack or a PHP script that can put today's events from the calander on a non-vB page, namely my site's main page. Maybe something cute in a Calander square looking dealy.

Thanks
Reply With Quote
  #2  
Old 05-01-2004, 10:54 PM
Pseudomizer's Avatar
Pseudomizer Pseudomizer is offline
 
Join Date: Mar 2002
Location: Germany
Posts: 614
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Curll
I'm looking for a hack or a PHP script that can put today's events from the calander on a non-vB page, namely my site's main page. Maybe something cute in a Calander square looking dealy.

Thanks
Hi Curl,

please use the following code to get the last 5 events in an array:

PHP Code:
$events $DB_site->query("select * from event order by dateline DESC limit 5");

if (
$DB_site->num_rows($events))
{
        while (
$ev $DB_site->fetch_array($events))
        {

    
$serveroffset date('Z'TIMENOW) / 3600;

    
$fromdate getdate(TIMENOW + (-12 $serveroffset) * 3600);
    
$new_date date('d-m-Y'TIMENOW + (-12 $serveroffset) * 3600 );
 
             echo 
$new_date," ";
//             echo $ev['userid']," ";
//             echo $ev['dateline']," ";
             
echo $ev['title'],"<BR>";
        }

Cheers,
Reply With Quote
  #3  
Old 05-02-2004, 02:09 PM
Curll's Avatar
Curll Curll is offline
 
Join Date: Apr 2003
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yay, thanks. That's a good start.
Reply With Quote
  #4  
Old 05-02-2004, 02:52 PM
Pseudomizer's Avatar
Pseudomizer Pseudomizer is offline
 
Join Date: Mar 2002
Location: Germany
Posts: 614
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Curll
Yay, thanks. That's a good start.
Hi Curl,

sorry but i just found one mistake. The dateline will never change in my previous code. Please use the following code:

PHP Code:
$events $DB_site->query("select * from event order by dateline DESC limit 5");

if (
$DB_site->num_rows($events))
{
        while (
$ev $DB_site->fetch_array($events))
        {
             
$new_date vbdate('d.m.Y'$ev['dateline'], falsefalse);
             
$news .= "<B>".$new_date."</B><BR>";
             
$news .= $ev['title']."<BR>";
             
        }

Reply With Quote
  #5  
Old 05-02-2004, 03:40 PM
P.Jackson P.Jackson is offline
 
Join Date: Sep 2003
Location: Newcastle,Uk
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what would be the code to get total threads and how many users online?
Reply With Quote
  #6  
Old 05-02-2004, 04:07 PM
Pseudomizer's Avatar
Pseudomizer Pseudomizer is offline
 
Join Date: Mar 2002
Location: Germany
Posts: 614
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by P.Jackson
what would be the code to get total threads and how many users online?
Users online:

PHP Code:
$onlineusers $DB_site->query("
                        ## GET ONLINE USERS ##
                        SELECT user.username, (user.options & 
$_USEROPTIONS[invisible]) AS invisible,
                        user.usergroupid, session.userid, session.lastactivity,
                        IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
                        FROM "
.TABLE_PREFIX."session AS session
                        LEFT JOIN "
.TABLE_PREFIX."user AS user ON (user.userid = session.userid)
                        WHERE session.lastactivity > 
$online[datecut]
                        ORDER BY "
.iif($permissions['genericpermissions'] & CANSEEHIDDEN'invisible ASC, ')."username ASC"); 
Total Threads:

PHP Code:
$totalthreads $DB_site->query("Select count(threadid) from thread where visible = '1' ); 
Cheers,
Reply With Quote
  #7  
Old 05-02-2004, 04:29 PM
P.Jackson P.Jackson is offline
 
Join Date: Sep 2003
Location: Newcastle,Uk
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

didnt work got parse errors
Reply With Quote
  #8  
Old 05-02-2004, 04:42 PM
Pseudomizer's Avatar
Pseudomizer Pseudomizer is offline
 
Join Date: Mar 2002
Location: Germany
Posts: 614
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by P.Jackson
didnt work got parse errors
What didn't work ? What kind of errors do you get ? Sorry but without any information i will not be able to help you at all.

Cheers,
Reply With Quote
  #9  
Old 05-02-2004, 05:23 PM
Curll's Avatar
Curll Curll is offline
 
Join Date: Apr 2003
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Odd, with the new code, no events are showing.
Reply With Quote
  #10  
Old 05-02-2004, 05:26 PM
Pseudomizer's Avatar
Pseudomizer Pseudomizer is offline
 
Join Date: Mar 2002
Location: Germany
Posts: 614
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Curll
Odd, with the new code, no events are showing.
I bet you did not write :tired:

PHP Code:
echo news
Cheers,
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:43 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.04264 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
  • (5)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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (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
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete