vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin Forum Sideblocks - NGG - Upcoming Events - Forum Side Block (https://vborg.vbsupport.ru/showthread.php?t=249833)

betts02 09-02-2010 10:00 PM

NGG - Upcoming Events - Forum Side Block
 
1 Attachment(s)
not Supported


Upcoming Events in Forum Block

I recently had a friend make this for me so i DO NOT support this and/or take any credit

I simply show you how to add the "Upcoming Events" in the forum side block

1/ Goto your Admincp

2/ Forums and moderators - Forum Blocks Manager

3/ Add block

4/ Name : Your choice

5/ Active : Yes

6/ Select : PHP

7/ In Content copy and paste :

PHP Code:

ob_start(); 


//  %d 
$show_count 5

$query sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%d' || (  dateline_from > '%d' AND dateline_to < '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count); 

$event_get vB::$db->query_read($query); 

$output_bits ''
while(
$event vB::$db->fetch_array($event_get)) { 

     if(
$event['dateline_to'] == 
     { 
         
$format sprintf("On %s",date('jS M Y',$event['dateline_from'])); 
     } else { 
         
$format sprintf("From %s to %s",date('jS M Y',$event['dateline_from']),date('jS M Y',$event['dateline_to'])); 
     } 
      
     
$output_bits .= sprintf(
        <div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d">%s</a></h4> 
            <p class="cms_widget_post_content">%s</p> 
        </div> 
        '
,$event['eventid'],$event['title'],$format); 


$output $output_bits


ob_end_clean(); 
return 
$output

8/ Template top use : block_html

You can see it in action and working here : NGG Clan

This is on vb4.0.5 and as stated - I can NOT SUPPORT this as i am no coder but i had it made for me at a small price and wanted to share it with the community here

Enjoy and please mark installed and comment if you use it, Cheers

Donations are welcome to betts02@tiscali.co.uk via paypal

betts02 09-03-2010 06:42 AM

To add, This is showing 1 day before the actual event - If anyone can futher this code to make it on the day, please pm me so i can change the code

Videx 09-03-2010 11:17 PM

Ya, I had that date issue with the other one too. The author had gone to great pains to try to fix it but the code had become a real mess and it still didn't work right.

Just glancing at this code I wonder if it supports multiple calendars and permissions? We have a Sponsors Calendar that lists advertiser's expiration dates and I wouldn't want that info displayed to everyone.

FatalCure 09-04-2010 07:51 AM

Fatal error: Class 'vB' not found in /home/public_html/includes/block/html.php(85) : eval()'d code on line 9

Anyone got any idea what I could do to resolve this?

starman? 09-04-2010 02:54 PM

Why pay for something that doesn't even work properly? Why even post the mod in the first place?

betts02 09-04-2010 04:08 PM

Its a free mod that needs a little ironing out, it works on my forum as you can see if you goto my site in the link below

v4.0.5 and as stated, NOT SUPPORTED

I can handle the day before while i get it fixed and thought another coder maybe able to futher it more

If you dont like it, Dont use it

ProFifaLeagues 09-04-2010 05:51 PM

Try this in place of the above in the forum block

PHP Code:

ob_start(); 


//  %d 
$show_count 5

$query sprintf("SELECT * FROM ".TABLE_PREFIX."event  WHERE visible = 1 AND (dateline_from > '%d' || (  dateline_from >  '%d' AND dateline_to < '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count); 

$event_get vB::$db->query_read($query); 

$output_bits ''
while(
$event vB::$db->fetch_array($event_get)) { 

     if(
$event['dateline_to'] == 
     { 
         
$format sprintf("On %s",date('jS M Y',$event['dateline_from'])); 
     } else { 
         
$format sprintf("From %s to %s",date('jS M Y',$event['dateline_from']),date('jS M Y',$event['dateline_to'])); 
     } 
      
     
$output_bits .= sprintf(
        [b]%s[/b]

 
            %s
 
         
        '
,$event['eventid'],$event['title'],$format); 


$output $output_bits

ob_end_clean();  
return 
$output


This works A1 on the forum blocks on our forum so hope it helps out a little

betts02 09-04-2010 06:43 PM

Using the above code ends up with - 79 NGG v X UK - MW 2 and not clickable, cheers for trying to help and hopefully someone else can work with this futher

cindy helmond 09-04-2010 07:21 PM

great !! can you change the coler of the links in the calendar ?

waynehindle 09-07-2010 08:20 PM

Worked a charm, thanks.


All times are GMT. The time now is 07:56 AM.

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.01257 seconds
  • Memory Usage 1,757KB
  • 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
  • (2)bbcode_php_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