Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
NGG - Upcoming Events - Forum Side Block Details »»
NGG - Upcoming Events - Forum Side Block
Version: 1.00, by betts02 betts02 is offline
Developer Last Online: Dec 2022 Show Printable Version Email this Page

Category: vBulletin Forum Sideblocks - Version: 4.0.5 Rating:
Released: 09-02-2010 Last Update: Never Installs: 25
Re-useable Code Translations Is in Beta Stage  
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 09-03-2010, 06:42 AM
betts02's Avatar
betts02 betts02 is offline
 
Join Date: Jun 2009
Posts: 910
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 09-03-2010, 11:17 PM
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Posts: 3,085
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 09-04-2010, 07:51 AM
FatalCure FatalCure is offline
 
Join Date: Jul 2006
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 09-04-2010, 02:54 PM
starman? starman? is offline
 
Join Date: Apr 2008
Posts: 181
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why pay for something that doesn't even work properly? Why even post the mod in the first place?
Reply With Quote
  #6  
Old 09-04-2010, 04:08 PM
betts02's Avatar
betts02 betts02 is offline
 
Join Date: Jun 2009
Posts: 910
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 09-04-2010, 05:51 PM
ProFifaLeagues's Avatar
ProFifaLeagues ProFifaLeagues is offline
 
Join Date: Aug 2009
Location: Uk
Posts: 1,191
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 09-04-2010, 06:43 PM
betts02's Avatar
betts02 betts02 is offline
 
Join Date: Jun 2009
Posts: 910
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 09-04-2010, 07:21 PM
cindy helmond cindy helmond is offline
 
Join Date: Feb 2006
Location: The Netherlands
Posts: 334
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great !! can you change the coler of the links in the calendar ?
Reply With Quote
  #10  
Old 09-07-2010, 08:20 PM
waynehindle waynehindle is offline
 
Join Date: Feb 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Worked a charm, thanks.
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 01:46 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.04980 seconds
  • Memory Usage 2,329KB
  • Queries Executed 24 (?)
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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)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
  • (9)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