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 CMS Widgets - Upcoming Events (https://vborg.vbsupport.ru/showthread.php?t=231365)

tomsch 06-26-2011 11:34 PM

ok the range events not displaying is fixed in this version


Code:

ob_start();
global $db,$vbulletin;


$mydate =  mktime(0, 0, 0, date("m"), date("d")-1, date("Y"));
$show_count =10;

$query = sprintf("        SELECT * FROM ".TABLE_PREFIX."event
                                        WHERE visible = 1
                                        AND (dateline_from >= '$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to))
                                        ORDER BY dateline_from ASC LIMIT $show_count");
                                       
$event_get = vB::$db->query_read($query);

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

    if($event['dateline_to'] == 0 )
    {
        $format = sprintf("On %s",vbdate('D M jS Y',$event['dateline_from'],false,true,false,true));
    } else {
        $format = sprintf("From %s to %s",vbdate('D M jS Y',$event['dateline_from'],false,true,false,true),vbdate('jS M Y',$event['dateline_to'],false,true,false,true));
    }
     
    $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();


Eq4bits 06-27-2011 07:12 AM

Awesome, tomsch! Thanks bunches!.
I added the horizontal line to mine like this:
Code:

<p class="cms_widget_post_content">%s<br><img src="images/hz-line.png"></p>

toxin 06-29-2011 04:01 PM

Range events are working, but when there's a recurring event the widget only displays the range.

I have created a recurring event. The range is starting Jan 01, ending Dec 31 and the event is 1st Sunday of every month.

The event is listed, but the widget just displays this:
My Event
From Sat Jan 1st 2011 to 31st Dec 2011
And because the range started Jan 1st, this event is always at the top of the list.

rcull 07-02-2011 02:38 AM

I just tried this code and got the following error:

Parse error: syntax error, unexpected T_STRING in /home/teambuic/public_html/forums/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 32

Thanks

tomsch 07-02-2011 12:01 PM

[QUOTE=rcull;2215721]I just tried this code and got the following error:

Parse error: syntax error, unexpected T_STRING in /home/teambuic/public_html/forums/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 32

Thanks[/Q

sounds like you either have a cut and paste error or the widget configured wrong

rcull 07-02-2011 12:59 PM

Thanks,
It was a cut and paste error!

kylek 07-31-2011 08:53 PM

Quote:

Originally Posted by Eq4bits (Post 2213416)
Awesome, tomsch! Thanks bunches!.
I added the horizontal line to mine like this:
Code:

<p class="cms_widget_post_content">%s<br><img src="images/hz-line.png"></p>


Where would you add this to the code? Looking for either a line between events or just a space.

Thanks tomsch for all your input you have added!

level8 08-17-2011 06:21 PM

wow great updates thanks for making this even better... is it possible to add a generic icon next to each post?
if so where would you insert the code?

level8 08-17-2011 06:29 PM

Quote:

Originally Posted by level8 (Post 2033847)
great widget...
can anyone help with 2 things?
1. How do I add a link at the bottom of the widget called somethign like "Add an Event" which simply will link to the http://****.com/calender.php?
2. Add a small icon image next to all events (https://vborg.vbsupport.ru/external/2011/08/21.gif ).

Any help is much appreciated :)

this is what i need help on :)

XrayHead 10-01-2011 08:30 AM

Hi All

Anyone know how to lose the stupid PHP icon in the upper top left?

https://vborg.vbsupport.ru/external/2011/10/77.png

Elenna 10-08-2011 09:59 PM

Quote:

Originally Posted by XrayHead (Post 2251879)
Hi All

Anyone know how to lose the stupid PHP icon in the upper top left?

You'll need to edit the "vbcms_widget_execphp_page" template to remove the reference to that image.

i.e.
Find:
Code:

<h3><img src="{vb:stylevar imgdir_siteicons}/php.png" alt="" /> {vb:raw title}</h3>
Replace with:
Code:

<h3>{vb:raw title}</h3>

vb.help 10-09-2011 02:29 AM

Can anybody please post a code ?

I tried with the code in the main page and it gives a blank page.

I also created an event for tomorrow to test but nothing showed up. Please help !!


Quote:

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'] == 0 )
{
$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 rel="nofollow" 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();

XrayHead 10-09-2011 05:39 PM

Quote:

Originally Posted by Elenna (Post 2254869)
You'll need to edit the "vbcms_widget_execphp_page" template to remove the reference to that image.

i.e.
Find:
Code:

<h3><img src="{vb:stylevar imgdir_siteicons}/php.png" alt="" /> {vb:raw title}</h3>
Replace with:
Code:

<h3>{vb:raw title}</h3>

Cool thanks for that, I changed to the following so I have a nice Calender ICON now :)

PHP Code:

<h3><img src="{vb:stylevar imgdir_misc}/event.png" alt="" /> {vb:raw title}</h3


https://vborg.vbsupport.ru/external/2011/10/65.png

Fraggs 10-14-2011 09:12 PM

This is probably entirely off-topic to this widget specifically, but I was hoping someone could help me out. Once I create the widget, I click configure, and copy the code in. But when I hit Save, it closes out the Configure box without saving the changes, and when I hit Configure again the default PHP Widget code is still there. I have narrowed it down to pretty much just the PHP Widgets, at least as far as what I use. I can still edit and save my Static HTML Widgets just fine. Any ideas?

Edit: Nevermind, it is Widget specific. It's just not saving THIS code. I can delete the default and save it blank, or save it with random text, but it will not save this code.

misericorde 11-12-2011 09:04 AM

hY

Not work with 4.1.7

Chiaki 11-15-2011 07:42 PM

The widget only shows one date to me, even though I have two test events and even though they have names. How come?
I use the newest vB 4 installment in German.

mmoore5553 11-20-2011 03:30 PM

How do we get this installed. i have tried everything . I setup as per instructions and nothing.

Ozy 12-20-2011 11:25 PM

Quote:

Originally Posted by toxin (Post 2214610)
Range events are working, but when there's a recurring event the widget only displays the range.

I have created a recurring event. The range is starting Jan 01, ending Dec 31 and the event is 1st Sunday of every month.

The event is listed, but the widget just displays this:
My Event
From Sat Jan 1st 2011 to 31st Dec 2011
And because the range started Jan 1st, this event is always at the top of the list.

Any way to get help on this? Ranged reoccurring events are problematic and the ONLY issue remaining for me. We have our monthly general and board meetings defined in our calendar, and the widget shows the entire range.


Thunderbird Hamfest
From Sat Jan 7th 2012 to 7th Jan 2012
Board Meeting
From Fri Jan 13th 2012 to 13th Jan 2014
General Meeting
From Fri Jan 20th 2012 to 1st Feb 2013
Arizona Centennial
On Sun Feb 12th 2012

I need it to say the date for the upcoming event, and not display the range. It's completely useless that way. Many people have asked for help on this and they have all gotten ignored.

Please help us!

Thx

skokarl 01-04-2012 12:20 PM

thanks, it's okay with 4.1.9

UK CHI3F 01-18-2012 03:37 PM

Does anyone know how to change the text colour for the header to
#00FF00 (green)

but i want to leave the date as white

Sorry a bit of a newb on code

mfowler70 01-27-2012 05:02 PM

Only problem I have with this mod is that it shows an event for tomorrow just fine, but not the next one, which is two weeks away.

killerford 02-02-2012 02:01 PM

No file to download for some reason?

Schoelle 02-03-2012 03:37 PM

Quote:

Originally Posted by killerford (Post 2295371)
No file to download for some reason?

Just read the description. It's only a few lines. Everything what you need is there.

Volvoholic 02-14-2012 11:49 AM

This widget does not display recurring events :(

Instead, it displays an event name with a date range. Is there a way to make the widget display recurring events? For example;

PHP programming 101 <---- Recurring
Tuesday March 1 2012

Advanced PHP programing
Wednesday March 2 2012

Weekend Coffee Morning
Saturday March 5 2012

PHP programming 101 <--- Recurring repeated
Tuesday March 8 2012

AkihiroKytori 02-23-2012 05:44 AM

Same issue here. Its a pain to find a widget to do what we need. I really think im gonna have to keep modding the heck out of what I find for every thing I need to do.

And im not a PhP coder...

Toorak Times 02-23-2012 02:14 PM

Mate, you have made my week!!!! I have been trying to find a simple events widget for my gig guide for a long time. Perfect little tool. I also need something 'bigger' in this area, keep me posted. Thanks again, woohoo! So easy too, a mod I couldn't muck up!

Tri@de 03-27-2012 07:11 AM

There's a way to get events from a differend calendar?

nasko 03-28-2012 06:55 PM

Can I make this block to show events from chosen calendar not all calendars?

Elenna 04-10-2012 01:14 AM

See updated code in future post.

SweCastel 04-10-2012 06:44 AM

1 Attachment(s)
After the latest update from vBulletin 4.1.12 the calender is not showing when using the option: Show whole article on sectionpage.

It´s have been working before, now is it only showing the raw code!
When visiting the articles own page to display the article then it is working.

But I want it to be displayed as before on "the multi-articles page".

Elenna 04-10-2012 11:21 AM

Hmm, I haven't updated to 4.1.12 yet (I usually like to have others find the remaining bugs!).

Does the widget work when that option is turned off?

Elenna 04-10-2012 03:52 PM

I have updated the code to work with single-day events, events that have already started but havn't ended, etc. Thanks to tomsch for the mkdate snippet!

I believe I got user time zone correction to work. Please see the following code:

Note: This version checks for the user's preferred date and time display settings (i.e. UK vs US, etc) and displays things accordingly. This can also pull from one or more selected calendars, per the instructions below (see orange comments).

PHP Code:

ob_start(); 
//Change $show_count to change how many events to display in the block
$show_count 5;
//Get the user's time zone
$user_tz vB::$vbulletin->userinfo['timezoneoffset'];
$tz_adjust $user_tz 3600;
$mydate =  mktime(000date("m"), date("d")-1date("Y"));
 
//Get events from the table
//Use the code below to pull from ALL calendars
$query sprintf(" SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from >= '$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to)) ORDER BY dateline_from ASC LIMIT $show_count"); 
//To pull from just certain calendars, comment out the above $query and uncomment the line below. Change the "AND calendarids in (1, 2, 3)" to match your calendar IDs to pull
//$query = sprintf(" SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from >= '$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to)) AND calendarids in (1, 2, 3) ORDER BY dateline_from ASC LIMIT $show_count"); 
$event_get vB::$db->query_read($query); 
$output_bits ''
while(
$event vB::$db->fetch_array($event_get)) { 
 
// Convert user timezone offset into minutes
$offset $user_tz;
 
// Only adjust start times for ranged events; all-day events should keep their midnight start time.
     
if($event['dateline_to'] == 
     { 
         
$from $event['dateline_from']; 
     } else { 
         
$from $event['dateline_from'] + $tz_adjust;
     } 
$to $event['dateline_to'] + $tz_adjust
 
 
$fromDate trim(vbdate(vB::$vbulletin->options['dateformat'],  $fromfalsetruefalsetrue));
$toDate trim(vbdate(vB::$vbulletin->options['dateformat'],  $tofalsetruefalsetrue));
$fromTime trim(vbdate(vB::$vbulletin->options['timeformat'],  $fromfalsetruefalsetrue));
$toTime trim(vbdate(vB::$vbulletin->options['timeformat'],  $tofalsetruefalsetrue));
 
if(
$event['dateline_to'] == 
 { 
 
$format sprintf("%s",$fromDate); 
     } else { 
 
$format sprintf("%s %s - %s",$fromDate$fromTime$toTime);
 } 
 
$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(); 


SweCastel 04-10-2012 08:30 PM

Quote:

Originally Posted by Elenna (Post 2318651)
Hmm, I haven't updated to 4.1.12 yet (I usually like to have others find the remaining bugs!).

Does the widget work when that option is turned off?

When Article is optioned as "Show full i sectionpage:
http://mustangclubsweden.org/content.php/116-kalender

Same article, but when it is opened:
http://mustangclubsweden.org/content...%C3%A4vle-Dala

It worked before 4.1.12... :/

Help :)

Elenna 04-10-2012 09:47 PM

This mod is meant to be used as a "Widget", so I am not sure about it being used as an Article? :(

I don't use it like that, so hopefully someone else can provide some assistance?

SweCastel 04-11-2012 08:43 PM

I know, but it did work before. :/

//D

Elenna 04-12-2012 01:03 AM

When adding the code to the article, are you using the PHP Direct Execution "type"?

If so, did you leave the template as "vbcms_content_phpeval_page"?

officer cartman 04-13-2012 05:03 PM

i want to display the next event for the next 7 days like you can at the bottom of the main forum display
however i want them to display in the cms in a sidebar using a widget
anyone any ideas ?
using this i get the events but it shows from and to i just want the events for that week

SweCastel 04-22-2012 01:53 PM

Quote:

Originally Posted by Elenna (Post 2319239)
When adding the code to the article, are you using the PHP Direct Execution "type"?

If so, did you leave the template as "vbcms_content_phpeval_page"?

Yes :/

Captainhilts 04-22-2012 05:10 PM

works perfectly as widget. Love it!

Is it possible to change to display how many signed up?

level8 04-24-2012 07:33 PM

on the main screen shot it shows a line underneath each event... however with the code copied it does show any lines???

Help??


All times are GMT. The time now is 09:59 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.01546 seconds
  • Memory Usage 1,865KB
  • 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
  • (7)bbcode_code_printable
  • (2)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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