• [MOD] Latest 5 videos on Home-Site 5 0 5 1
Currently:  

Author Topic: [MOD] Latest 5 videos on Home-Site  (Read 48522 times)

0 Members and 1 Guest are viewing this topic.

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
[MOD] Latest 5 videos on Home-Site
« on: August 07, 2009, 12:54:46 AM »
Hi good evening, I would like to know how to select which showed in the last 5 home videos sent to the site.

Example: Select from where image_media_file = .flv

I want to display the thumb and the video link to view it.

Somebody could help me please!
« Last Edit: August 07, 2009, 04:32:29 PM by mawenzi »

Rembrandt

  • Guest
Re: Mod request (View the latest 5 videos Site)
« Reply #1 on: August 07, 2009, 07:21:36 AM »
Hi!
an arbitrary number of files (e.g. jpg,flv) displayed in home.html:

search in index.php:

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

add before:

//################################# Start Custom Images ###################################################
$file_ext "flv";//   < < <   write your file extension here  e.g.  "jpg" or "mp3"< < <
$num_new_images "5";  //< < < how many images to be displayed < < <
$custom_sort "i.image_date";  //< < < how order? e.g. " i.image_rating, i.image_hits, i.image_votes, i.image_downloads,,i.image_date"< < <

$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").") AND image_media_file LIKE '%.$file_ext'
        ORDER BY 
$custom_sort DESC
        LIMIT 
$num_new_images";
$result $site_db->query($sql);
$num_rows2 $site_db->get_numrows($result);

if (!
$num_rows2)  {
  
$new_images2 "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$new_images2 .= $lang['no_new_images'];
  
$new_images2 .= "</td></tr></table>";
}
else  {
  
$new_images2 "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)){
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$new_images2 .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$new_images2 .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    
show_image($image_row);
    
$new_images2 .= $site_template->parse_template("thumbnail_bit");
    
$new_images2 .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$new_images2 .= "</tr>\n";
      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($num_new_images $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {
        
$new_images2 .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$new_images2 .= "</tr>\n";
    }
  }
  
$new_images2 .= "</table>\n";
// end else

$site_template->register_vars("custom_images"$new_images2);
unset(
$new_images2);
//################################# End Custom Images ###################################################


at the top of code put the file extension, how many images to displayed, and how sort by.

write in your home.html {custom_images}

mfg Andi
« Last Edit: October 18, 2009, 07:38:09 AM by Rembrandt »

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Latest 5 videos on Home-Site
« Reply #2 on: August 07, 2009, 10:22:40 AM »
... danke Andi ...
... da die Modifikation auch sinngem fr andere Dateitypen verwendet werden kann und so nicht im Request-Forum versauern soll ...
... Titel gendert und verschoben nach "Mods & Plugins (Releases & Support)" ...
Your first three "must do" before you ask a question ! ( by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: [MOD] Latest 5 videos on Home-Site
« Reply #3 on: August 07, 2009, 02:59:34 PM »
Rembrandt thank you for your help!
 :lol: :D

Excellent module for use on site

I Love 4images

Offline yellows

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: [MOD] Latest 5 videos on Home-Site
« Reply #4 on: September 17, 2009, 10:32:16 PM »
could you make this randomized like the new images mod ?

Rembrandt

  • Guest
Re: [MOD] Latest 5 videos on Home-Site
« Reply #5 on: September 18, 2009, 05:44:36 AM »
Hi!
could you make this randomized like the new images mod ?
sure, replace:
ORDER BY i.image_date DESC


with this:
ORDER BY RAND()



mfg Andi
« Last Edit: September 18, 2009, 05:42:21 PM by Rembrandt »

Offline ahsancharming

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: [MOD] Latest 5 videos on Home-Site
« Reply #6 on: October 08, 2009, 01:20:15 PM »
this works superbly..
thx alot once again. i luv 4images and through this forum my hopes come true :) now i have my gallery as i was imagining :)

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: [MOD] Latest 5 videos on Home-Site
« Reply #7 on: January 15, 2010, 05:08:24 AM »
cant w shot the latest media files from a category on index page ?
I'm Back :)

Rembrandt

  • Guest
Re: [MOD] Latest 5 videos on Home-Site
« Reply #8 on: January 15, 2010, 05:27:47 AM »
cant w shot the latest media files from a category on index page ?

search in the code:

$custom_sort 
"i.image_date";

insert below:

$cat_in 
= array(1,2,9,17); // your Cat ID's


search in the code:

 WHERE i
.image_active AND c.cat_id i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").") AND image_media_file LIKE '%.$file_ext'


replace:

 WHERE i
.image_active AND c.cat_id i.cat_id AND i.cat_id IN (".implode("",$cat_in).") AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").") AND image_media_file LIKE '%.$file_ext'


Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: [MOD] Latest 5 videos on Home-Site
« Reply #9 on: January 15, 2010, 05:33:25 AM »
Thanks .. thanks for the quick reply sir.. it works great  :wink:
I'm Back :)

Offline hongoctrien

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Thư viện tư liệu LNG ANH TUẤN
Re: [MOD] Latest 5 videos on Home-Site
« Reply #10 on: January 22, 2010, 07:59:31 AM »
I used mod video, I want show new video (I add video from youtube)?
http://anhtuanqt.net - Thư viện tư liệu LNG ANH TUẤN

Rembrandt

  • Guest
Re: [MOD] Latest 5 videos on Home-Site
« Reply #11 on: January 22, 2010, 10:59:19 AM »
I used mod video, I want show new video (I add video from youtube)?
look on the top of the code:
$file_ext "flv";//   < < <   write your file extension here  e.g.  "jpg" or "mp3"< < <

Offline Bommel

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [MOD] Latest 5 videos on Home-Site
« Reply #12 on: January 22, 2010, 12:21:14 PM »
Hallo allerseits,

ist es mglich in dieser Zeile:

Code: [Select]
$file_ext = "flv";//   < < <   write your file extension here  e.g.  "jpg" or "mp3"< < <
mehr als eine Endung fr Videos anzugeben? Wie mssen diese getrennt werden?

Freundliche Gre, Bommel
Freundliche Gre, Bommel

Nicht die Geduld mit mir verlieren, ich bin noch am Lernen./ Do not lose the patience with me, I am still in the learning. ;)

Offline hongoctrien

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Thư viện tư liệu LNG ANH TUẤN
Re: [MOD] Latest 5 videos on Home-Site
« Reply #13 on: January 22, 2010, 04:07:48 PM »
I used mod video, I want show new video (I add video from youtube)?
look on the top of the code:
$file_ext "flv";//   < < <   write your file extension here  e.g.  "jpg" or "mp3"< < <


I was replace flv by youtube but I don't see it
http://anhtuanqt.net - Thư viện tư liệu LNG ANH TUẤN

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: [MOD] Latest 5 videos on Home-Site
« Reply #14 on: January 22, 2010, 08:52:29 PM »
how to select all the file formats

Code: [Select]
$file_ext = "*";//   < < <   write your file extension here  e.g.  "jpg" or "mp3"< < <
i have a doubt bout this when using the mod media sites... its great if we can select ll the file extensions t once* .. thanks !
I'm Back :)

 

Post your comments here