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)

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

Quote:

Originally Posted by Tri@de (Post 2324551)
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!

Code:

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

Quote:

Originally Posted by level8 (Post 2325896)
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

Quote:

Originally Posted by level8 (Post 2325918)
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 :(


All times are GMT. The time now is 08:08 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.01558 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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