vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Help a girl adjust code on a widget please (https://vborg.vbsupport.ru/showthread.php?t=290720)

Miss T 11-15-2012 04:38 AM

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

Miss T 11-16-2012 07:04 AM

anybody ?

please.... it would really help me out a lot

Deriggs007 11-20-2012 03:59 AM

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


All times are GMT. The time now is 03:38 AM.

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.00944 seconds
  • Memory Usage 1,722KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete