Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

afficher 3 résultat dans la meme ligne

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
djkost85
Smarty Rookie


Joined: 24 Dec 2008
Posts: 5

PostPosted: Wed Dec 24, 2008 2:24 pm    Post subject: afficher 3 résultat dans la meme ligne Reply with quote

voici ma template
Code:
<link rel="stylesheet" type="text/css" href="<{$smarty.const.xoopstube_url}>/xtubestyle.css" /> <{if $show_categort_title == true}> <div style="margin-bottom: 4px;"><b><{$smarty.const._MD_XTUBE_CATEGORYC}></b><{$video.category}></div> <{/if}> <table>   <tr>       <td class="clip_item">       <div class="clip_title_list"><a href="<{$xoops_url}>/modules/<{$video.module_dir}>/singlevideo.php?cid=<{$video.cid}>&lid=<{$video.id}>"><{$video.title}></a></div>       <table>         <tr>           <td>            <{if $xoops_isadmin}><{$video.adminvideo}> <{/if}>  <{if $video.screen_shot}>                       <a href="<{$xoops_url}>/modules/<{$video.module_dir}>/singlevideo.php?cid=<{$video.cid}>&lid=<{$video.id}>" target=""><{$video.videothumb}></a>                  <{/if}>                  <div class="xoopstube_description">             <div><{$video.hits|wordwrap:50:"n":true}></div>             <div><{$smarty.const._MD_XTUBE_TIMEB}>&nbsp;<{$video.time}></div>              </div>     </td>      <{if $video.id is div by 2}>       </tr>       <tr>     <{/if}>            </tr>       </table>              <{if $video.published == 0 }>        <tr>            <td> <div class="even" align="center"> <small> <a href="<{$xoops_url}>/modules/<{$video.module_dir}>/ratevideo.php?cid=<{$video.cid}>&lid=<{$video.id}>"><{$smarty.const._MD_XTUBE_RATETHISFILE}></a> | <a href="<{$xoops_url}>/modules/<{$video.module_dir}>/brokenvideo.php?lid=<{$video.id}>"><{$smarty.const._MD_XTUBE_REPORTBROKEN}></a> | <{if $video.useradminvideo}> <a href="<{$xoops_url}>/modules/<{$video.module_dir}>/submit.php?lid=<{$video.id}>"> <{$smarty.const._MD_XTUBE_MODIFY}></a> | <{/if}> <a target="_top" href="mailto:?subject=<{$video.mail_subject}>&body=<{$video.mail_body}>"><{$smarty.const._MD_XTUBE_TELLAFRIEND}></a> | <a href="<{$xoops_url}>/modules/<{$video.module_dir}>/singlevideo.php?cid=<{$video.cid}>&lid=<{$video.id}>"><{$smarty.const._COMMENTS}> (<{$video.comments}>)</a> </small> </div></td>    </tr>    <{/if}> </table><br />


voici le lien de mon site où se trouve mon problème.
http://www.simozik.com/modules/Videos/viewcat.php?op=&cid=1
les clips appariassent l'un en dessus de l'autre.
Merci d'avance


Last edited by djkost85 on Wed Dec 24, 2008 6:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
djkost85
Smarty Rookie


Joined: 24 Dec 2008
Posts: 5

PostPosted: Wed Dec 24, 2008 6:36 pm    Post subject: Reply with quote

Voici le code php
Code:
<?php
/**
 * $Id: viewcat.php
 * Module: MyTube
 */

include 'header.php';

// Begin Main page Heading etc
$cid = xtube_cleanRequestVars( $_REQUEST, 'cid', 0 );
$selectdate = xtube_cleanRequestVars( $_REQUEST, 'selectdate', '' );
$list = xtube_cleanRequestVars( $_REQUEST, 'list', '' );
$cid = intval($cid);

$catsort = $xoopsModuleConfig['sortcats'];
$mytree = new XoopsTree( $xoopsDB -> prefix( 'xoopstube_cat' ), 'cid', 'pid' );
$arr = $mytree -> getFirstChild( $cid, $catsort );

if ( is_array( $arr ) > 0 && !$list && !$selectdate ) {
    if ( false == xtube_checkgroups( $cid ) ) {
        redirect_header( "index.php", 1, _MD_XTUBE_MUSTREGFIRST );
        exit();
    }
}

$xoopsOption['template_main'] = 'xoopstube_viewcat.html';

include XOOPS_ROOT_PATH . '/header.php';

global $xoopsModuleConfig, $xoopsModule;

$catarray['imageheader'] = xtube_imageheader();
$xoopsTpl -> assign( 'catarray', $catarray );

// Breadcrumb
$pathstring = "<a href='index.php'>" . _MD_XTUBE_MAIN . "</a>&nbsp;:&nbsp;";
$pathstring .= $mytree -> getNicePathFromId( $cid, "title", "viewcat.php?op=" );
$xoopsTpl -> assign( 'category_path', $pathstring );
$xoopsTpl -> assign( 'category_id', $cid );

// Display Sub-categories for selected Category
if ( is_array( $arr ) > 0 && !$list && !$selectdate ) {
    $scount = 1;
    foreach( $arr as $ele ) {
        if ( xtube_checkgroups( $ele['cid'] ) == false ) {
            continue;
        }
        $sub_arr = array();
        $sub_arr = $mytree -> getFirstChild( $ele['cid'], $catsort );
        $space = 1;
        $chcount = 1;
        $infercategories = "";
        foreach( $sub_arr as $sub_ele ) {
            // Subitem file count
            $hassubitems = xtube_getTotalItems( $sub_ele['cid'] );
            // Filter group permissions
            if ( true == xtube_checkgroups( $sub_ele['cid'] ) ) {
                // If subcategory count > 5 then finish adding subcats to $infercategories and end
                if ( $chcount > 5 ) {
                    $infercategories .= "...";
                    break;
                }
                if ( $space > 0 )
                    $infercategories .= ", ";

                $infercategories .= "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule -> getVar( 'dirname' ) . "/viewcat.php?cid=" . $sub_ele['cid'] . "'>" . $xtubemyts -> htmlSpecialCharsStrip( $sub_ele['title'] ) . "</a> (" . $hassubitems['count'] . ")";
                $space++;
                $chcount++;
            }
        }
        $totalvideos = xtube_getTotalItems( $ele['cid'] );
        $indicator = xtube_isnewimage( $totalvideos['published'] );
                /*
      * This code is copyright WF-Projects
      * Using this code without our permission or removing this code voids the license agreement
      *
      */

        $_image = ( $ele['imgurl'] ) ? urldecode( $ele['imgurl'] ) : "";
   if ( $_image != "" && $xoopsModuleConfig['usethumbs'] ) {
            $_thumb_image = new xtubeThumbsNails( $_image, $xoopsModuleConfig['catimage'], 'thumbs' );
       if ( $_thumb_image ) {
                $_thumb_image -> setUseThumbs( 1 );
                $_thumb_image -> setImageType( 'gd2' );
                $_image = $_thumb_image -> do_thumb( $xoopsModuleConfig['shotwidth'],
                    $xoopsModuleConfig['shotheight'],
                    $xoopsModuleConfig['imagequality'],
                    $xoopsModuleConfig['updatethumbs'],
                    $xoopsModuleConfig['keepaspect']
                    );
            }
        }
       
   if ( empty( $_image ) || $_image == '' ) {
            $imgurl = $indicator['image'];
            $_width = 33;
            $_height = 24;
        } else {
            $imgurl = "{$xoopsModuleConfig['catimage']}/$_image";
            $_width = $xoopsModuleConfig['shotwidth'];
            $_height = $xoopsModuleConfig['shotheight'];
        }
        /*
   * End
   */

        $xoopsTpl -> append( 'subcategories',
            array( 'title' => $xtubemyts -> htmlSpecialCharsStrip( $ele['title'] ),
                'id' => $ele['cid'],
                'image' => XOOPS_URL . "/$imgurl",
                'width' => $_width,
                'height' => $_height,
                'infercategories' => $infercategories,
                'totalvideos' => $totalvideos['count'],
                'count' => $scount,
                'alttext' => $ele['description'] )
            );
        $scount++;
    }
}
/**
 * Show Description for Category listing
 */
$sql = "SELECT title, description, nohtml, nosmiley, noxcodes, noimages, nobreak, imgurl, client_id, banner_id FROM " . $xoopsDB -> prefix( 'xoopstube_cat' ) . " WHERE cid=" . intval( $cid );
$head_arr = $xoopsDB -> fetchArray( $xoopsDB -> query( $sql ) );
$html = ( $head_arr['nohtml'] ) ? 0 : 1;
$smiley = ( $head_arr['nosmiley'] ) ? 0 : 1;
$xcodes = ( $head_arr['noxcodes'] ) ? 0 : 1;
$images = ( $head_arr['noimages'] ) ? 0 : 1;
$breaks = ( $head_arr['nobreak'] ) ? 1 : 0;
$description = $xtubemyts -> displayTarea( $head_arr['description'], $html, $smiley, $xcodes, $images, $breaks );
$xoopsTpl -> assign( 'description', $description );
$module_handler = &xoops_gethandler( 'module' );
$versioninfo = &$module_handler -> get( $xoopsModule -> getVar( 'mid' ) );
if ($head_arr['title'] > '') {
  $xoopsTpl -> assign( 'xoops_pagetitle', $versioninfo -> getInfo( 'name' ) . ":&nbsp;" . $head_arr['title'] );
  } else {
  $xoopsTpl -> assign( 'xoops_pagetitle', $versioninfo -> getInfo( 'name' ) );
}

if ($head_arr['client_id'] > 0) {
  $catarray['imageheader'] = xtube_getbanner_from_id_client( $head_arr['client_id'] );
} elseif ($head_arr['banner_id'] > 0) {
  $catarray['imageheader'] = xtube_getbanner_from_id_banner( $head_arr['banner_id'] );
} else {
  $catarray['imageheader'] = xtube_imageheader();
}
$xoopsTpl -> assign( 'catarray', $catarray );
// Extract linkload information from database
$xoopsTpl -> assign( 'show_categort_title', true );

$start = xtube_cleanRequestVars( $_REQUEST, 'start', 0 );
$orderby = ( isset( $_REQUEST['orderby'] ) && !empty( $_REQUEST['orderby'] ) ) ? xtube_convertorderbyin( htmlspecialchars($_REQUEST['orderby']) ) : xtube_convertorderbyin( $xoopsModuleConfig['linkxorder'] );

if ( $selectdate ) {
    $d = date( "j", $selectdate );
    $m = date( "m", $selectdate );
    $y = date( "Y", $selectdate );

    $stat_begin = mktime ( 0, 0, 0, $m, $d, $y );
    $stat_end = mktime ( 23, 59, 59, $m, $d, $y );

    $query = " WHERE published >= " . $stat_begin . " AND published <= " . $stat_end . "
      AND (expired = 0 OR expired > " . time() . ")
      AND offline = 0
      AND cid > 0";

    $sql = "SELECT * FROM " . $xoopsDB -> prefix( 'xoopstube_videos' )
     . $query
     . " ORDER BY "
     . $orderby;
    $result = $xoopsDB -> query( $sql, $xoopsModuleConfig['perpage'] , $start );

    $sql = "SELECT COUNT(*) FROM " . $xoopsDB -> prefix( 'xoopstube_videos' )
     . $query;
    list( $count ) = $xoopsDB -> fetchRow( $xoopsDB -> query( $sql ) );

    $list_by = 'selectdate=' . $selectdate;
} elseif ( $list ) {
    $query = " WHERE title LIKE '$list%'
      AND (published > 0 AND published <= " . time() . ")
      AND (expired = 0 OR expired > " . time() . ")
      AND offline = 0
      AND cid > 0";

    $sql = "SELECT * FROM " . $xoopsDB -> prefix( 'xoopstube_videos' )
     . $query
     . " ORDER BY "
     . $orderby;
    $result = $xoopsDB -> query( $sql, $xoopsModuleConfig['perpage'] , $start );

    $sql = "SELECT COUNT(*) FROM " . $xoopsDB -> prefix( 'xoopstube_videos' )
     . $query;
    list( $count ) = $xoopsDB -> fetchRow( $xoopsDB -> query( $sql ) );
    $list_by = "list=$list";
} else {
    $sql = "SELECT DISTINCT a.* FROM " . $xoopsDB -> prefix( 'xoopstube_videos' ) . " a LEFT JOIN "
     . $xoopsDB -> prefix( 'xoopstube_altcat' ) . " b "
     . " ON b.lid = a.lid"
     . " WHERE a.published > 0 AND a.published <= " . time()
     . " AND (a.expired = 0 OR a.expired > " . time() . ") AND a.offline = 0"
     . " AND (b.cid=a.cid OR (a.cid=" . intval($cid) . " OR b.cid=" . intval($cid) . "))"
     . " ORDER BY "
     . $orderby;
    $result = $xoopsDB -> query( $sql, $xoopsModuleConfig['perpage'] , $start );
    $xoopsTpl -> assign( 'show_categort_title', false );

    $sql2 = "SELECT count(*) FROM " . $xoopsDB -> prefix( 'xoopstube_videos' ) . " a LEFT JOIN "
     . $xoopsDB -> prefix( 'xoopstube_altcat' ) . " b "
     . " ON b.lid = a.lid"
     . " WHERE a.published > 0 AND a.published <= " . time()
     . " AND (a.expired = 0 OR a.expired > " . time() . ") AND a.offline = 0"
     . " AND (b.cid=a.cid OR (a.cid=" . intval($cid) . " OR b.cid=" . intval($cid) . "))";
    list( $count ) = $xoopsDB -> fetchRow( $xoopsDB -> query( $sql2 ) );
    $order = xtube_convertorderbyout($orderby);
    $list_by = "cid=$cid&orderby=$order";
}
$pagenav = new XoopsPageNav( $count, $xoopsModuleConfig['perpage'] , $start, 'start', $list_by );

// Show links
if ( $count > 0 ) {
    $moderate = 0;
    while ( $video_arr = $xoopsDB -> fetchArray( $result ) ) {
        $res_type = 0;
   require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule -> getVar( 'dirname' ) . '/include/videoloadinfo.php';
        $xoopsTpl -> append( 'video', $video );
    }

    // Show order box
    $xoopsTpl -> assign( 'show_videos', false );
    if ( $count > 1 && $cid != 0 ) {
        $xoopsTpl -> assign( 'show_videos', true );
        $orderbyTrans = xtube_convertorderbytrans( $orderby );
        $xoopsTpl -> assign( 'lang_cursortedby', sprintf( _MD_XTUBE_CURSORTBY, xtube_convertorderbytrans( $orderby ) ) );
        $orderby = xtube_convertorderbyout( $orderby );
    }

    // Screenshots display
    $xoopsTpl -> assign( 'show_screenshot', false );
    if ( isset( $xoopsModuleConfig['screenshot'] ) && $xoopsModuleConfig['screenshot'] == 1 ) {
        $xoopsTpl -> assign( 'shotwidth', $xoopsModuleConfig['shotwidth'] );
        $xoopsTpl -> assign( 'shotheight', $xoopsModuleConfig['shotheight'] );
        $xoopsTpl -> assign( 'show_screenshot', true );
    }

    // Nav page render
    $page_nav = $pagenav -> renderNav();
    $istrue = ( isset( $page_nav ) && !empty( $page_nav ) ) ? true : false;
    $xoopsTpl -> assign( 'page_nav', $istrue );
    $xoopsTpl -> assign( 'pagenav', $page_nav );
    $xoopsTpl -> assign( 'module_dir', $xoopsModule -> getVar( 'dirname' ) );
}
unset( $video_arr );

include XOOPS_ROOT_PATH . '/footer.php';

?>
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP