Digitalraindrops

Sample Code

Jan 30th, 2011
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.79 KB | None | 0 0
  1. <?php
  2. function drfb_content_html( $newcontent ) {
  3.     global $stored_container;
  4.     if ( $stored_container['page-number'] && $stored_container['row-number'] ) {
  5.         global $stored_page_1,$stored_page_2,$stored_page_3,$stored_page_4;
  6.         if( $stored_container['page-number' =='page-1'] && (!isset($stored_page_1) || !$stored_page_1 ) ) return;
  7.         if( $stored_container['page-number' =='page-2'] && (!isset($stored_page_2) || !$stored_page_2 ) ) return;
  8.         if( $stored_container['page-number' =='page-3'] && (!isset($stored_page_3) || !$stored_page_3 ) ) return;
  9.         if( $stored_container['page-number' =='page-4'] && (!isset($stored_page_4) || !$stored_page_4 ) ) return;
  10.         $colwidth = explode(":", $stored_container['row-layout'], 4 );
  11.         array_unshift($colwidth, 0);
  12.         $styleclass = $stored_container['page-number'] .'-'. $stored_container['row-number'];
  13.        
  14.         //Build Layout
  15.         $layout ='';
  16.         $layout = $layout .'                <div class="'.$styleclass.'">' ."\n";
  17.        
  18.         for ($counter=1; $counter < 4; $counter++) {
  19.             if ( $colwidth[$counter] ) {
  20.                 $layout = $layout .'                    <div class="'.$styleclass .$counter .'">' ."\n";
  21.                 $layout = $layout .'                        <div class="'.$styleclass .$counter .'-inner">' ."\n";
  22.                
  23.                 if ( $newcontent['column-video-'.$counter] ) {
  24.                     $style='style="text-align:'. $newcontent['video-align-'.$counter] .';"';
  25.                     if ( $newcontent['video-size-'.$counter] == 'large' ) {
  26.                         $width=480;
  27.                         $height=385;
  28.                     }else{
  29.                         $width=290;
  30.                         $height=220;       
  31.                     }
  32.                     $layout = $layout .'                            <div class="youtube-video" '.$style.'>' ."\n";
  33.                     $layout = $layout .'                                <ul>' ."\n";
  34.                     $layout = $layout .'                                <li>' ."\n";
  35.                     $layout = $layout .'                                    <object width="'.$width.'" height="'.$height.'"><param name="movie" value="http://www.youtube.com/v/'.$newcontent['column-video-'.$counter].'&hl=en&fs=1&rel=0&border=1"></param>' ."\n";
  36.                     $layout = $layout .'                                    <param name="allowFullScreen" value="true"></param>' ."\n";
  37.                     $layout = $layout .'                                    <param name="allowscriptaccess" value="always"></param>' ."\n";
  38.                     $layout = $layout .'                                    <embed src="http://www.youtube.com/v/'.$newcontent['column-video-'.$counter].'&hl=en&fs=1&rel=0&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$width.'" height="'.$height.'"></embed>' ."\n";
  39.                     $layout = $layout .'                                    </object>' ."\n";
  40.  
  41.                     $layout = $layout .'                                </li>' ."\n";
  42.                     $layout = $layout .'                                </ul>' ."\n";
  43.                     $layout = $layout .'                            </div>' ."\n";
  44.                 }                  
  45.                 $layout = $layout .'                            '.$newcontent['column-text-'.$counter] ."\n";
  46.                 $layout = $layout .'                        </div>' ."\n";
  47.                 $layout = $layout .'                    </div>' ."\n";
  48.             }
  49.         }  
  50.         $layout = $layout .'                </div>' ."\n";
  51.  
  52.         $stored_page_1['row-1-html'] = $layout;
  53.         update_option( 'drfb_page_1', $stored_page_1 );
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment