Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-16-2011, 05:38 AM
goshalim goshalim is offline
 
Join Date: Oct 2007
Posts: 470
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default PhP code Horizondal

Hi

I have this PHP code below show randomly pictures from users Albums.
The code works perfectly but can someone help me to change instead of Vertical to show this in Horizondal
Your help is much appreciated.

PHP Code:
// Display random images thumbnails taken from any public albums. 
// Author : Sulquendi 
// Version: 1.2 

// -- Widget Configuration --  
$use_vB_thumbnail_size     false
$use_custom_css         false
$twidth                 190
$limit                    1
$albums_list            ""


// -- Nothing to configure below this line -- 
if ($use_custom_css){ 
    
$pthumb     'class="pthumb"'
    
$pcaption    'class="pcaption"'
    
$pmore        'class="pmore"'
    
$pstyle        ''
}else{ 
    
$pthumb     'style="text-align:center;"'
    
$pcaption    'style="text-align:center;font-style:italic;font-family: Times, serif;margin-bottom:10px;"'
    
$pmore        'style="text-align:right;display:block;"'
    
$pstyle        'style="border: 1px solid black;padding:4px;background: white;"'

if (
$albums_list!=""$sup_cond "AND alb.albumid IN ($albums_list)"; else $sup_cond =""
ob_start(); 
require_once(
DIR '/includes/functions_album.php'); 
require_once(
DIR '/includes/functions_user.php'); 
$pic_get vB::$db->query_read(
    SELECT     alb.albumid, att.attachmentid, att.userid, att.caption, att.dateline, att.state, fdt.filesize, IF(fdt.thumbnail_filesize > 0, 1, 0) AS hasthumbnail, fdt.thumbnail_dateline, fdt.thumbnail_width, fdt.thumbnail_height, u.username 
    FROM "
.TABLE_PREFIX."album AS alb 
    LEFT JOIN "
.TABLE_PREFIX."attachment AS att ON alb.albumid = att.contentid 
    LEFT JOIN "
.TABLE_PREFIX."filedata AS fdt ON att.filedataid = fdt.filedataid 
    LEFT JOIN "
.TABLE_PREFIX."user AS u ON att.userid = u.userid 
    WHERE alb.state = 'public' AND att.contenttypeid = '8' 
$sup_cond 
    ORDER BY rand(" 
microtime()*1000000 ")  
   LIMIT 
$limit"); 
  
$output_bits ""
  while(
$pic vB::$db->fetch_array($pic_get)) 
  { 
    
$albuminfo fetch_albuminfo($pic[albumid]); 
    
$picture prepare_pictureinfo_thumb($pic$albuminfo); 
    if (
$use_vB_thumbnail_size$size $picture[dimensions]; else $size "width=$twidth"
    
$output_bits .= "<div $pthumb><a href=\"album.php?{$vbulletin->session->vars['sessionurl']}albumid={$pic[albumid]}&attachmentid={$picture[attachmentid]}\"><img $pstyle src=\"attachment.php?{$vbulletin->session->vars['sessionurl']}attachmentid={$picture[attachmentid]}&thumb=1&d={$picture[thumbnail_dateline]}\" alt=\"{$picture[caption_preview]}\" $size /></a>"
    
$output_bits .= "</div><div $pcaption>{$picture[caption_preview]} by {$pic[username]}</div>"
  } 
$output_bits .= '<span '.$pmore.'><a href="album.php" alt="To the albums">More...</a></span>'
$output $output_bits
ob_end_clean(); 
Reply With Quote
 


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 02:40 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.06622 seconds
  • Memory Usage 2,380KB
  • Queries Executed 12 (?)
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)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • 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_threaded
  • showthread_threaded_construct_link
  • 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