Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 11-15-2012, 04:38 AM
Miss T Miss T is offline
 
Join Date: Sep 2008
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help a girl adjust code on a widget please

I have this calendar widget - i love it... BUT i need a little adjustment and i am no programmer

i cannot wright code and dont know what to change so it works the way i want it

right now the code shows all the events after the current day.. i want it to show the events that happens TODAY also - i dont want it to delete an event from overview at 00.01 on the day it occurs...

i dont want it to disappear before 23.59 on the day it has happened - it must show all day


and second: if i have a ranged event it shows wrong - this output makes no sense whn you see it in the overwiew

Code:
   $format = sprintf("Fra d. %s til d. %s",date('d-m-Y',$event['dateline_from']),date('d-m-Y',$event['dateline_to']
I would very much like the ranged event to show like:

"From 14:00 to 20.00 on the 22.03.2013" if you understand... so that i show the events timeframe and date....

or:

"From 14:00 on the 22.04.2013 to 15.04.2013 on the 23.04.2013" it it is a 2 day event.... if that is to complex never mind... the solution above is fine - i hardly ever have 2 day events anyway...

Right now it shows the date twice and just looks wrong...

please help

heres the intire code... - i know the really cool coders in here will have no problem looking at this and point exactly to what i need changed... god i wish i had a flair for this

Code:
ob_start();

//  %d
$show_count = 7;

$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("d. %s",date('d-m-Y',$event['dateline_from']));
     } else {
         $format = sprintf("Fra d. %s til d. %s",date('d-m-Y',$event['dateline_from']),date('d-m-Y',$event['dateline_to']));
     }
     
     $output_bits .= sprintf('
        <div style="height:20px;" class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d">%s</a>
           (%s)</h4>
        </div>
        ',$event['eventid'],$event['title'],$format);

}

if ($output_bits == "")
{
$output = "Ingen fremtidige events";
}
else
{
$output = $output_bits;
}

ob_end_clean();

please help a girl in distress


Thansk

Miss T
Reply With Quote
  #2  
Old 11-16-2012, 07:04 AM
Miss T Miss T is offline
 
Join Date: Sep 2008
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anybody ?

please.... it would really help me out a lot
Reply With Quote
  #3  
Old 11-20-2012, 03:59 AM
Deriggs007 Deriggs007 is offline
 
Join Date: Feb 2011
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Heya Miss T.

Give me just a moment and I'll look into it for you. If I don't reply back, it's cause I got too busy since I'm active duty military and I've forgotten about it, lol.

Reply back shortly, hopefully.

--------------- Added [DATE]1353387667[/DATE] at [TIME]1353387667[/TIME] ---------------

Okay back (that was quick)

PHP Code:
 AND (dateline_from >= '%d' || (  dateline_from '%d' AND dateline_to '%d' )) 
That is what's controlling it
Reply With Quote
Reply

Thread Tools
Display Modes

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:58 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.10871 seconds
  • Memory Usage 2,172KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete