vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Calander on non-VB pages (https://vborg.vbsupport.ru/showthread.php?t=64584)

Curll 04-30-2004 08:02 PM

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

Pseudomizer 05-01-2004 10:54 PM

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,

Curll 05-02-2004 02:09 PM

Yay, thanks. That's a good start.

Pseudomizer 05-02-2004 02:52 PM

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>";
             
        }



P.Jackson 05-02-2004 03:40 PM

what would be the code to get total threads and how many users online?

Pseudomizer 05-02-2004 04:07 PM

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,

P.Jackson 05-02-2004 04:29 PM

didnt work :( got parse errors

Pseudomizer 05-02-2004 04:42 PM

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,

Curll 05-02-2004 05:23 PM

Odd, with the new code, no events are showing.

Pseudomizer 05-02-2004 05:26 PM

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,


All times are GMT. The time now is 06:49 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01122 seconds
  • Memory Usage 1,759KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete