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

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

0 Members and 1 Guest are viewing this topic.

Rembrandt

  • Guest
« Last Edit: February 21, 2010, 07:14:39 AM by Rembrandt »

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Latest 5 videos on Home-Site
« Reply #31 on: March 03, 2010, 11:15:13 PM »
Hi Andi,

Thanks for the great mod. I have installed it and have read through all the posts to add some of the other recommendations, like featuring other video formats, ... even if they won't play in some browsers. I will definitely push our members to use .flv.

Two questions:

1. In your mod, you recommend adding {custom_images} to the home.html table which I did but I wanted it to look neat and clean like the 'New Images' table. Attached is the pic of our page. I added a $lang setting in main.php for custom_images but it doesn't show. For the longest time, I couldn't understand why the new lang setting did not appear until I realized that the rows in the {custom_images} are taller than the {new_images} and for that reason, they are overlapping the bar above, hiding the lang setting.  Is there a code to adjust in the index.php for the {custom_images} or in the home.html code? Here is the code that I used in the home.html to construct the table.

<table width="828" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="4">
                          <tr>
                            <td class="head1" valign="top">{lang_new_images}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td class="head1">{new_images}</td>
                    </tr>
                  <b>
                <br />
                </td>
               <table width="828" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="4">
                          <tr>
                            <td class="head1" valign="top">{lang_custom_images}</td>
                          </tr>
                        </table>
                      </td>
                    </tr><br />
                    <tr>
                      <td class="head1">{custom_images}</td>
                    </tr>
                  <b>
                <br />
                </td>

2. In this thread, some of the users ask how to remove the video files from being featured in the New Images table. I tried to follow along but I just did not get it. Is is as simple as adding the code
Quote
AND ((image_media_file LIKE '%.flv') OR (image_media_file LIKE '%.wmv') OR (image_media_file LIKE '%.avi') OR (image_media_file LIKE '%.mov') OR (image_media_file LIKE '%.mpg'))

to the Show New Images section, and just specifying the media files that I want to see in the New Images section?
[EDIT] did that and specified .jpg, .gif, and .png   Success! Hopefully I am not shooting myself in the foot by omitting other file formats ...



Thanks,

Brian
« Last Edit: March 03, 2010, 11:26:36 PM by surferboy »

Rembrandt

  • Guest
Re: [MOD] Latest 5 videos on Home-Site
« Reply #32 on: March 04, 2010, 07:17:38 AM »
Hi!

first the html part:
Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="4">
                          <tr>
                            <td class="head1" valign="top">{lang_new_images}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td class="head1">{new_images}</td>
                    </tr>
                  </table>
                  <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="4">
                          <tr>
                            <td class="head1" valign="top">{lang_custom_images}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td class="head1">{custom_images}</td>
                    </tr>
                  </table>
                  <br>

to your second question, this is the code for the custom slq:

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 '%.flv') OR (image_media_file LIKE '%.wmv') OR (image_media_file LIKE '%.avi') OR (image_media_file LIKE '%.mov') OR (image_media_file LIKE '%.mpg'))


and this is the part for the original slq query (new_images):

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 NOT((image_media_file LIKE '%.flv') OR (image_media_file LIKE '%.wmv') OR (image_media_file LIKE '%.avi') OR (image_media_file LIKE '%.mov') OR (image_media_file LIKE '%.mpg'))


mfg Andi
« Last Edit: March 04, 2010, 07:29:08 AM by Rembrandt »

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Latest 5 videos on Home-Site
« Reply #33 on: March 04, 2010, 10:50:07 AM »
Hi Andi,

Thanks so much for providing the corrected template code.  I pasted everything just as you indicated but no luck on making the title appear in the bar. It still is half-covered.  I did a test where I changed the {lang_custom_images] to {lang_new_images} and sure enough, the title appeared, as 'New Images'

That makes me think the $lang code is not right but it is there in main.php, bright as day.  Then I wondered if somehow the code in the index.php file was creating the problem.  All I could find was a mention of {lang_new_images} with the RSS code in the original sequence.

I have no idea what is blocking this lang code from appearing!

Any ideas?

Thanks,

Brian

Rembrandt

  • Guest
Re: [MOD] Latest 5 videos on Home-Site
« Reply #34 on: March 04, 2010, 11:54:23 AM »
ahh.. ok
in lang/yourlang/main.php:

$lang
['custom_images'] = "yourtext";


search in index.php:

$site_template
->register_vars("custom_images"$new_images2);

and replace:

$site_template
->register_vars(array(
"lang_custom_images" => $lang['custom_images'],
  
"custom_images" => $new_images2
));


in the html file you can now write
Code: [Select]
{lang_custom_images}
mfg Andi
« Last Edit: March 04, 2010, 10:14:39 PM by Rembrandt »

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Latest 5 videos on Home-Site
« Reply #35 on: March 04, 2010, 07:38:55 PM »
Hi Andi,

Yes, that did the trick.  You didn't mention the file to replace the
$site_template->register_vars("custom_images", $new_images2);

but I understood what you meant - index.php

It looks so great. I love polish!

Thanks,

Brian

Rembrandt

  • Guest
Re: [MOD] Latest 5 videos on Home-Site
« Reply #36 on: March 04, 2010, 10:14:06 PM »
...
but I understood what you meant - index.php....
yes, i am forgot to write

mfg Andi

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Latest 5 videos on Home-Site
« Reply #37 on: March 23, 2010, 08:18:02 PM »
Hi -

Got another question about this MOD - latest 5 videos.

Just posted this reply on here:
http://www.4homepages.de/forum/index.php?topic=24054.msg146558#msg146558

I have installed the Media sites v1.9 MOD and got it working.

Is there a way to have these uploaded remote URL vids appear in this MOD, showing the latest 5 videos? That would be the ultimate perfect solution.  I know that the code in the index.php is very specific: it has to specify a file name for the vid to appear, and these remote uploaded URL's are not specific file names.

What do you think?

Thanks in advance for looking at this.

Cheers,

Brian

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Latest 5 videos on Home-Site
« Reply #38 on: March 24, 2010, 02:56:18 AM »
Now that I know what mod you were referring to, I can suggest go different way, by using additional field where it would store file extension.
assuming you've added new database field into 4images_images table, named image_ext (there is a tutorial about additional fields, sorry, don't have time find that topic for you).

then in member.php find:
    if (!$uploaderror) {

insert below:
      $HTTP_POST_VARS['image_ext'] = get_file_extension($new_name);


this will store file extension (including virtual extensions from media sites mod) at image upload from members upload form.

after this you can modify mysql query for this mod to something like this:

$file_ext_list $file_ext;
foreach(
$media_sites as $key => $val)
{
  
$file_ext_list .= ",'" $key "'";
}

$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' OR image_ext IN ($file_ext_list))
        ORDER BY 
$custom_sort DESC
        LIMIT 
$num_new_images";

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Latest 5 videos on Home-Site
« Reply #39 on: March 24, 2010, 07:31:52 AM »
Hi -

Thanks for the help!

I made the changes to the member.php file and then pasted the query string you provided into the index.php file.  There was one glitch that was a major error but I fixed that - I added i.image_ext in the list of the query and that let me login but ...

then this error appears at the top of the home page:

An unexpected error occured. Please try again later.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home1/glrfinfo/public_html/gotchagallery/includes/db_mysql.php on line 116

and none of the previous files show up or any new uploaded files (I uploaded one .flv personal vid and one remote url youtube vid) 

I can understand why the older ones wouldn't show up - they don't have anything in the new image_ext field I added to the images table.  But then I had a look at the latest two entries in the table and nothing was entered in the image_ext field.

If we can just figure out why the uploads aren't adding any data into the new image_ext field, we might be good to go.

Thanks,

Brian