vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Block/widget help (https://vborg.vbsupport.ru/showthread.php?t=329585)

oldfan 05-20-2023 10:57 AM

Block/widget help
 
Im trying to have this block/widget out the info with the user avatar, posted by, etc... Similar the Recent Threads output

I included the template and block/widget code.

thanks

PHP Code:

<li>
    <
div class="block smaller">
        <
div class="blocksubhead">
            <
class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a><img src="{vb:stylevar imgdir_cms}/widget-forum.png" alt="" />
            <
span class="blocktitle">{vb:raw blockinfo.title}</span>
        </
div>
        <
div class="widget_content blockbody floatcontainer">
        <
div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow">
            {
vb:raw content}
        </
div>
        </
div>
    </
div>
    <
div class="underblock"></div>
</
li>&#8203; 


PHP Code:

ob_start();
global 
$db$vbulletin;
$show_count 10;
$query sprintf("SELECT * FROM " TABLE_PREFIX "event
    WHERE visible = 1
    AND (
       (MONTH(FROM_UNIXTIME(dateline_from)) = MONTH(NOW()) AND DAY(FROM_UNIXTIME(dateline_from)) = DAY(NOW()))
       OR
       (MONTH(FROM_UNIXTIME(dateline_to)) = MONTH(NOW()) AND DAY(FROM_UNIXTIME(dateline_to)) = DAY(NOW()))
    )
    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"], falsetruefalsetrue)
        );
    }
    
$output_bits .= sprintf("
        <div class='noavatarcontent floatcontainer widget_post_bit'>
            <div class='widget_post_userinfo'></div>
            <div class='smallavatartext widget_post_comment_noavatar'>
                <h5 class='widget_post_header'>
                    <a href='calendar.php?do=getinfo&e=%d' class='title'>%s</a>
                </h5>
                <div class='meta'>%s</div>
            </div>
        </div>"
,
        
$event["eventid"],
        
$event["title"],
        
$format
    
);
}
$output $output_bits;
ob_end_clean();&#8203; 



All times are GMT. The time now is 06:40 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.01145 seconds
  • Memory Usage 1,737KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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