View Full Version : vBulletin CMS Widgets - Upcoming Events
Elenna
10-08-2011, 09:59 PM
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:
<h3><img src="{vb:stylevar imgdir_siteicons}/php.png" alt="" /> {vb:raw title}</h3>
Replace with:
<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 !!
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
You'll need to edit the "vbcms_widget_execphp_page" template to remove the reference to that image.
i.e.
Find:
<h3><img src="{vb:stylevar imgdir_siteicons}/php.png" alt="" /> {vb:raw title}</h3>
Replace with:
<h3>{vb:raw title}</h3>
Cool thanks for that, I changed to the following so I have a nice Calender ICON now :)
<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.
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
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
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 (https://vborg.vbsupport.ru/showpost.php?p=2213285&postcount=241) 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).
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(0, 0, 0, date("m"), date("d")-1, date("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'] == 0 )
{
$from = $event['dateline_from'];
} else {
$from = $event['dateline_from'] + $tz_adjust;
}
$to = $event['dateline_to'] + $tz_adjust;
$fromDate = trim(vbdate(vB::$vbulletin->options['dateformat'], $from, false, true, false, true));
$toDate = trim(vbdate(vB::$vbulletin->options['dateformat'], $to, false, true, false, true));
$fromTime = trim(vbdate(vB::$vbulletin->options['timeformat'], $from, false, true, false, true));
$toTime = trim(vbdate(vB::$vbulletin->options['timeformat'], $to, false, true, false, true));
if($event['dateline_to'] == 0 )
{
$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
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.php/828-Tr%C3%A4fflistan-G%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
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??
Eq4bits
04-24-2012, 08:14 PM
This is the code with the hz line, items you will need to change: which calendar, how many events, and location of the hz line image; the date format used is: m/d/Y if you'd rather dashes just change the '/'s to '-'s; if you'd rather d/m/Y then switch it to that display instead in both locations.
ob_start();
global $db,$vbulletin;
$mydate = mktime(0, 0, 0, date("m"), date("d")-1, date("Y"));
$calendarid="1";
$show_count =6;
$query = sprintf(" SELECT * FROM ".TABLE_PREFIX."event
WHERE visible = 1
AND calendarid='".$calendarid."'
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('m/d/Y',$event['dateline_from'],false,true,false,true));
} else {
$format = sprintf("From %s to %s",vbdate('m/d/Y',$event['dateline_from'],false,true,false,true),vbdate('m.d',$event['dateline_to'],false,true,false,true));
}
$output_bits .= sprintf('
<div class = "cms_widget_post_bit"><img src="images/****/hz-line.png"><br><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();Attached is a hz line image you can feel free to use:
level8
04-25-2012, 09:01 AM
This is the code with the hz line, items you will need to change: which calendar, how many events, and location of the hz line image; the date format used is: m/d/Y if you'd rather dashes just change the '/'s to '-'s; if you'd rather d/m/Y then switch it to that display instead in both locations.
Attached is a hz line image you can feel free to use:
thanks for this will get it changed ASAP... wonder if you coudl help with 2 other things, tried to do it myself but just crashes :(
1. How do I add a link/button 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/images/cstyle/blue/statusicon/forum_new.gif ).
Any help is much appreciated :)
ProFifaLeagues
04-25-2012, 09:12 AM
thanks for this will get it changed ASAP... wonder if you coudl help with 2 other things, tried to do it myself but just crashes :(
1. How do I add a link/button 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/images/cstyle/blue/statusicon/forum_new.gif ).
Any help is much appreciated :)
Superb Idea that and one i would love to know how to implement too:up:
Eq4bits
04-27-2012, 03:13 AM
here is code for adding a small icon in front of each event listed:
to have it as a clickable link to the listed event use
ob_start();
global $db,$vbulletin;
$mydate = mktime(0, 0, 0, date("m"), date("d")-1, date("Y"));
$calendarid="1";
$show_count =6;
$query = sprintf(" SELECT * FROM ".TABLE_PREFIX."event
WHERE visible = 1
AND calendarid='".$calendarid."'
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('m/d/Y',$event['dateline_from'],false,true,false,true));
} else {
$format = sprintf("From %s to %s",vbdate('m/d/Y',$event['dateline_from'],false,true,false,true),vbdate('m/d/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"><img src="images/*****/light-color-calendar.gif"
style="border: 0px solid; border: 0px solid; width: 16px; height: 16px;">%s</a></h4>
<p class="cms_widget_post_content">%s</p><img src="images/*****/hz-line.png" align="top">
</div>
',$event['eventid'],$event['title'],$format);
}
$output = $output_bits;
ob_end_clean();you'll need to put your calendar id # in and the # of events to show, as well as the addy/location of where you have the hz-line.png and the light-color-calendar.gif located in your files. I've attached the hz-line.png and the light-color-calendar.gif (Thanks for the gif level8 ;))
http://pendletonharbor.net/images/PHPOA/test-events.png
I'm still trying to get a clickable 'button'/image for the bottom for 'add new event' but, so far I've only been able to add that to each and every event listed (which seems a bit redundant to me); I'll continue to play with the code when I can to see if I can get it to display a single 'button'/image after the list of events. No promises ;)
Tri@de
04-27-2012, 05:43 AM
There's a way to put an external link (got inside the event) instead of a link to the calendar event?
level8
04-27-2012, 06:31 AM
BIG THANKS TO Eq4bits amazing work :)
Tr@de.. I know you can add custom fields to the event and Ive seen people import this on the events list (i.e. webpage link) for external events.. however finding anyone to help with the code has been difficult :(
Eq4bits
04-28-2012, 01:09 PM
This is if you want an external link added (as well as a new calendar icon that is not a link itself... perhaps a bit more 'pleasing to the eye' to some (I also edited out the 'On' preceeding the date because it bugged me ;))
http://pendletonharbor.net/images/PHPOA/test-events2.png
ob_start();
global $db,$vbulletin;
$mydate = mktime(0, 0, 0, date("m"), date("d")-1, date("Y"));
$calendarid="1";
$show_count =6;
$query = sprintf(" SELECT * FROM ".TABLE_PREFIX."event
WHERE visible = 1
AND calendarid='".$calendarid."'
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("%s",vbdate('m/d/Y',$event['dateline_from'],false,true,false,true));
} else {
$format = sprintf("From %s to %s",vbdate('m.d',$event['dateline_from'],false,true,false,true),vbdate('m.d',$event['dateline_to'],false,true,false,true));
}
$output_bits .= sprintf('
<div class="cms_widget_post_bit">
<h4 class="cms_widget_post_header">
<table>
<tbody>
<tr>
<td><img src="images/*****/cal.png" align:"center"=""
v-align:"middle"=""> </td>
<td><a href="calendar.php?do=getinfo&e=%d">%s</a><br>
<small><small><a href="http://*********">External Link</a></small></small>
<p class="cms_widget_post_content">%s</p>
</td>
</tr>
<tr align="center">
<td colspan="2" style="vertical-align: top;">
<h4 class="cms_widget_post_header"><img alt="line"
src="images/*****/hz-line.png" align="middle"></h4>
</td>
</tr>
</tbody>
</table>
</h4>
</div>
',$event['eventid'],$event['title'],$format); }
$output = $output_bits;
ob_end_clean();
Also attaching new calendar image and a 'shorter' hz-line image as the previous one was too wide to display correctly in the widget when on certain size sidebars/columns ;)
mrt12345
04-28-2012, 01:28 PM
Thanks , but can you tell me the image path where to upload the new icons. Thanks:up:
mrt12345
04-28-2012, 01:37 PM
ok thanks i figured it out, nice job, just fill in all the ********:o
level8
04-29-2012, 07:26 AM
if anyone can help all we are working on now is getting the "external link" to be a custom field path... so you will keep the word "External link" however this will link to whatever the web path has been listed in the custom field.... any help appreciated :)
Tri@de
04-29-2012, 10:14 AM
I modified the code to take the link on the event description (in this way you have only to write the link in the description), and also modified the code to select a different calendar. if you want it, just let me know.
ProFifaLeagues
04-29-2012, 10:38 AM
I modified the code to take the link on the event description (in this way you have only to write the link in the description), and also modified the code to select a different calendar. if you want it, just let me know.
Be great if we can have it please Tri@de thank you :up:
Tri@de
04-29-2012, 11:24 AM
Here you are!
ob_start();
// %d
$show_count = 5;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE calendarid = 5 AND 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("Il %s",date('d-m-Y',$event['dateline_from']));
} else {
$format = sprintf("Dal %s al %s",date('d-m-Y',$event['dateline_from']),date('d-m-Y',$event['dateline_to']));
}
$output_bits .= sprintf('
<div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><h4 class="cms_widget_post_header"><a href="%s" target="_blank">%s</a></h4>
<p class="cms_widget_post_content">%s</p>
</div>
',$event['event'],$event['title'],$format);
}
$output = $output_bits;
ob_end_clean();
The red number id the calendar id you have to modify as you wish.
As i said before, in the description put only the link (including http:// ) or the link doesen't work properly.
level8
04-30-2012, 11:18 AM
what if in the description there is 2 links?? how does it know which to pick up?
Tri@de
04-30-2012, 12:10 PM
in the link, you find http://firstlink-secondlink i suppose.
i made it to get only a link.
The best for this widget is to make a customfield and using it for urls.
level8
05-03-2012, 04:56 PM
yeah thats what I have done.. just importing the info from the custom field (the website address) and replacing it in the href="%s" target="_blank is proving tricky!!
Tri@de
05-03-2012, 06:08 PM
yeah thats what I have done.. just importing the info from the custom field (the website address) and replacing it in the href="%s" target="_blank is proving tricky!!
you made with custom field?
can you give me the code?
level8
05-03-2012, 06:18 PM
I just went into the calender and added a custom field.. it was part of the default options!
Tri@de
05-03-2012, 06:49 PM
I just went into the calender and added a custom field.. it was part of the default options!
Yes, but how you put in the code. i tried, but i've done somthing wrong...
level8
05-03-2012, 06:57 PM
thats what I cant do either :( find a way of feeding that into the widget :(
Tri@de
05-03-2012, 07:12 PM
Ah.. yes, because, the customfields record have inside also the setting of the custom field. the only way is to separate the options
level8
05-09-2012, 06:54 AM
mm.. still cant work it out :( anyone else had any joy on this?!?!
Kiint
05-16-2012, 09:51 AM
What I would like on this is for it to show recurring events up to 4 weeks in advance, so if i had an event scheduled for every wednesday then the widget would show this event 4 times, plus any other events inbetween them, eg:
weekly event
single event
weekly event
weekly event
monthly event
weekly event
etc etc
with a limit of 10 events,.. possible?
Kiint
05-22-2012, 03:24 PM
Anyone? The way it displays recurring event's is pretty bad, only shows the next one coming, not any others, and that one is at the top because it was created before all the others, not inline like the daily events are......
Eq4bits
05-22-2012, 11:32 PM
What I would like on this is for it to show recurring events up to 4 weeks in advance, so if i had an event scheduled for every wednesday then the widget would show this event 4 times, plus any other events inbetween them, eg:
weekly event
single event
weekly event
weekly event
monthly event
weekly event
etc etc
with a limit of 10 events,.. possible?
all that's a bit more than I can do code wise =S sorry... what I had to do on mine was enter recurring events individually (i used sql to do that on the database end - i.e. insert into _events - used an online unix date converter for dates ;) )
but
you set your limit of events in the widget code itself:
$show_count = 5; by changing the '5' to whatever you want... 10, 15, 20
Eq4bits
05-22-2012, 11:36 PM
Yes, but how you put in the code. i tried, but i've done somthing wrong...
I read somewhere that with the calendar custom field you have to 'unserialize' it first - in the widget code - then you can pull from it
ignore this post, wrong mod thread!!!
zapiy
01-11-2013, 07:30 PM
Can i use this on VBadvanced as a module is some way please?
mna703
01-25-2013, 03:30 PM
great plugin, thanks! One problem though.....If I have an event set for lets say 9-11pm EST, the event disappears from the viewer right after 9pm. I would like the event to stay posted throughout the duration of the event...is there anyway to make the event stay for the duration of the event (9-11pm) instead of disappearing rite at 9pm?
Thanks!
fxdigi-cash
05-08-2013, 04:39 AM
is it possible to display the upcoming events on top of forumhome instead of sideblock??
imported_EkSeS
05-08-2013, 05:57 AM
is it possible to display the upcoming events on top of forumhome instead of sideblock??
Another mod do that: Upcoming Events on Top of Pages (https://vborg.vbsupport.ru/showthread.php?t=246092)
----
I have installed & edited some Fields of this Mod :
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("Am %s",date('d.m.y',$event['dateline_from']));
} else {
$format = sprintf("Am %s",date('d.m.y ',$event['dateline_from']),date('d.m.y H:i',$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();
Well ..
I have multiple calendars.
1. Visible for guests
2. Visible for users
3. Visible for moderators
On the CMS, guests can see the all the Event Titles :eek:
Permissions of 2. & 3. Calendars are hidden for guests
How can i hide the Titles for guests ?
fxdigi-cash
05-08-2013, 07:45 AM
Another mod do that: Upcoming Events on Top of Pages (https://vborg.vbsupport.ru/showthread.php?t=246092)
----
I tried that one, but there is a date bug... and needs to be fixed...
fxdigi-cash
05-09-2013, 02:11 AM
still there is an issue with expired events... they still there after all while they are supposed to be removed when events finished........
Update: the expired event get removed one day after the event date... not big issue. Thanks
behcet
07-25-2013, 06:46 PM
ob_start();
global $db,$vbulletin;
$mydate3 = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
// %d
$show_count =10;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from >= '$mydate3' || ( dateline_from >= '$mydate3' 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",vbdate('D M jS Y',$event['dateline_from'],false,true,false,true));
} else {
$format = sprintf("From %s to %s",vbdate('D M jS Y h:i:s A',$event['dateline_from'],false,true,false,true),vbdate('jS M Y h:i:s A',$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;
this will display the times for the Range events. But there is a small catch when you enter the range event leave the time zone setting to GMT.
i left off the time for the all day event as its always the same time because of the way its stored.
i also fixed a bug in my code the mydate3 variable was commented out for my fixed date.
tnx, my problem solved
rotor
12-12-2013, 12:59 AM
Another mod do that: Upcoming Events on Top of Pages (https://vborg.vbsupport.ru/showthread.php?t=246092)
----
I have installed & edited some Fields of this Mod :
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("Am %s",date('d.m.y',$event['dateline_from']));
} else {
$format = sprintf("Am %s",date('d.m.y ',$event['dateline_from']),date('d.m.y H:i',$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();
Well ..
I have multiple calendars.
1. Visible for guests
2. Visible for users
3. Visible for moderators
On the CMS, guests can see the all the Event Titles :eek:
Permissions of 2. & 3. Calendars are hidden for guests
How can i hide the Titles for guests ?
After using this on a 4.2.2 site I now have an error:
Parse error: syntax error, unexpected ';' in /home/XXXXXXXX/public_html/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 4
even after I deleted the widget I still get the errors!!!!
so what has it changed elsewhere??
any ideas????
twistedsoul
05-30-2016, 02:53 AM
great widget, but is there a way to display the event in a color other than white?
oldfan
04-15-2023, 03:43 PM
works 4.2.4, php 7.2
any there a way to make it to show multiple years like a event on april 15 2023 and april 15 1999?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.