vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Major Additions - Links and Downloads Manager (https://vborg.vbsupport.ru/showthread.php?t=119041)

|oR|Greg 11-08-2006 07:14 PM

Ok, I know it's controlled somewhere between lines 1587 and 1680 in the local_links.php... I just don't know how, or what...

AndrewD 11-08-2006 07:47 PM

Quote:

Originally Posted by elsupremo
Andrew,

I don't know how long this has been going on, but it seems the 2.2.6 series of upgrades have created a problem with Firefox. For one thing, "Save Link As" does not work, and it instead tries to download an html page instead of the download. Secondly, and more significantly, if I left click on the link, the save as dialogue box only has the first 2 characters in my file name - and no extension. Example: I have a file name named: CC 10-07-06 720.wmv. When I left click on it in Firefox, the dialogue box only has "CC" in the save as line, with no extension added.

The left click and save target as functions work normally in both Opera and Internet Explorer (6 and 7).

Thank you for any advice in resolving this issue. I hope you are able to replicate this issue.

Yes, there was a change in the HTTP headers sent before the file, to try to get round another problem. I spotted this in 2.2.6 rc1 but hadn't yet made the new rc available.

Edit local_links.php and go down to line 2094, for the sequence that reads:

Code:

        if (HEADER_BEHAVIOUR == "inline") {
//                @header("Content-disposition: inline; filename=\"".$dfname."\"");
                @header("Content-disposition: inline; filename=".$dfname."");
        } else {
                @header("Content-type: application/x-download");
//                @header("Content-disposition: attachment; filename=\"".$dfname."\"");
                @header("Content-disposition: attachment; filename=".$dfname."");
        }

You can do one of two things, depending on your preference. Either swap round the comment flags, so that code reads:

Code:

        if (HEADER_BEHAVIOUR == "inline") {
                @header("Content-disposition: inline; filename=\"".$dfname."\"");
//                @header("Content-disposition: inline; filename=".$dfname."");
        } else {
                @header("Content-type: application/x-download");
                @header("Content-disposition: attachment; filename=\"".$dfname."\"");
//                @header("Content-disposition: attachment; filename=".$dfname."");
        }

(which takes it back to 2.2.5 behaviour) or replace the lines by the following:

Code:

        if (HEADER_BEHAVIOUR == "inline") {
                @header("Content-disposition: inline; filename=".str_replace(" ", "_", $dfname)."");
        } else {
                @header("Content-type: application/x-download");
                @header("Content-disposition: attachment; filename=".str_replace(" ", "_", $dfname)."");
        }

which is how I intend to handle this in the final 2.2.6 (space in file names will be translated into underscore characters).

Let me know how this works.

As far as the first problem goes, I can't think straight about this - I've just got off the train from a 5 hour journey and need to sleep...

AndrewD 11-08-2006 07:54 PM

Quote:

Originally Posted by |oR|Greg
I'm SO close to making Google Video and You Tube videos play within LDM... I just need one last step!!!!

Andrew, I got the IF statement working inside the links_playbit template by adding some more code to the original WIMPY Player plugin that I changed for the FLV Player. Here is the code that I added to the plugin:
PHP Code:

if(stristr($url'video.google.com/videoplay?docid=') == TRUE) { 
$player "google"

$google_patterns = array(
    
'http://video.google.com/videoplay\?docid=(.*?)&(.*?)',
    
'http://video.google.com/videoplay\?docid=(.*?)',
);
$google_rep = array(
    
'http://video.google.com/videoplay?docid=$1',
    
'http://video.google.com/videoplay?docid=$1',
);
$url preg_replace($google_patterns$google_rep$url);
}

if(
stristr($url'youtube.com/watch?v=') == TRUE) { 
$player "youtube";

$youtube_patterns = array(
    
'http://www.youtube.com/watch\?v=(.*?)&(.*?)',
    
'http://www.youtube.com/watch\?v=(.*?)',
    
'http://youtube.com/watch\?v=(.*?)&(.*?)',
    
'http://youtube.com/watch\?v=(.*?)',
);
$youtube_rep = array(
    
'http://www.youtube.com/watch?v=$1',
    
'http://www.youtube.com/watch?v=$1',
    
'http://www.youtube.com/watch?v=$1',
    
'http://www.youtube.com/watch?v=$1',
);
$url preg_replace($youtube_patterns$youtube_rep$url);


Now, here is the code I added to the links_playbit:
HTML Code:

<if condition="$player=='youtube'">
<object width="640" height="480" type="application/x-shockwave-flash" data="$url">
<param name="movie" value="$url" />
<param name="wmode" value="transparent" />
<em><strong>ERROR:</strong> If you can see this, then <a href="http://www.youtube.com/">YouTube</a> is down or you don't have Flash installed.</em>
</object>
</if>

<if condition="$player=='google'">
<object width="640" height="480" type="application/x-shockwave-flash" data="$url">
<param name="movie" value="$url" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="quality" value="best" />
<param name="scale" value="noScale" />
<param name="wmode" value="transparent" />
<param name="salign" value="TL" />
<param name="FlashVars" value="playerMode=embedded" />
<em><strong>ERROR:</strong> If you can see this, then <a href="http://video.google.com/">Google Video</a> is down or you don't have Flash installed.</em>
</object>
</if>

There are 2 prolems I think...
  1. When I add a new url entry to LDM like http://www.youtube.com/watch?v=X4ery9QRfpA, it goes OFF-site and opens a new window rather then opening in the same window with an embeded player, all because it's not a local file.
  2. The jukebox settings require a file type. There is none for this, so I don't know what to do for that either.
Pretty please help me out, I'm SOOO close to embedding these (I think). Aren't you proud of me too, because I wrote my first plugin code?

For your second question, edit includes/local_links_include.php, and go to line 2451 (in 2.2.6 rc), which reads

Code:

if (($user_mac or $user_windows) and get_mimetype($urlType) and in_array($urlType, $musicboxtypes)) $is_musicbox = 1;
Try adding something like:

Code:

if(stristr($linkurlurl, 'video.google.com/videoplay?docid='))  $is_musicbox = 1;

FARMER 11-08-2006 08:57 PM

I don't know which file I can browse it to play music (using jukebox) & I don't know where I can manager me media???

plz help me!

elsupremo 11-08-2006 09:05 PM

Quote:

Originally Posted by AndrewD
Edit local_links.php and go down to line 2094...
...replace the lines by the following:
which is how I intend to handle this in the final 2.2.6 (space in file names will be translated into underscore characters).

Let me know how this works.

Andrew you fixed it. :) Save link as still doesn't work, but that's a smaller issue. Thanks!

AndrewD 11-09-2006 06:29 AM

Quote:

Originally Posted by obmob
Sweet, that did the trick! Thanks. :D

Now, i have a feature request... hope Andrew won't kick me :laugh:

Well, there is a links_favbit, and links_editbit... you think it might be possible, in a future release, to include a links_downloadbit?

This would be a simple download link to be shown, the same as edit ot favorites... well, just that ^^

Thanks for everything!

You mean you'd like to show the green download arrow icon when the user is allowed to download the file? That's easy - I'll include this in the final 2.2.6.

If you mean something else, could you give me more details?

|oR|Greg 11-09-2006 12:05 PM

Quote:

Originally Posted by AndrewD
For your second question, edit includes/local_links_include.php, and go to line 2451 (in 2.2.6 rc), which reads

Code:

if (($user_mac or $user_windows) and get_mimetype($urlType) and in_array($urlType, $musicboxtypes)) $is_musicbox = 1;
Try adding something like:

Code:

if(stristr($linkurlurl, 'video.google.com/videoplay?docid='))  $is_musicbox = 1;

I'll wait till the final 2.2.6... any idea on a date?

AndrewD 11-09-2006 04:21 PM

Quote:

Originally Posted by |oR|Greg
I'll wait till the final 2.2.6... any idea on a date?

soon... someone's doing what I hope is the final testing on it at present.

AndrewD 11-09-2006 04:35 PM

Quote:

Originally Posted by elsupremo
Andrew,

... It seems the 2.2.6 series of upgrades have created a problem with Firefox. For one thing, "Save Link As" does not work, and it instead tries to download an html page instead of the download.

This is not due to LDM. It is a well-discussed 'feature' of Firefox (see https://bugzilla.mozilla.org/show_bu...id=299372#c89). Basically, IE/Opera go to the server to find out some header information, whereas Firefox doesn't. The arguments for Firefox's behaviour are straightforward - they want to make downloads start up more quickly.

Maybe Firefox gurus have developed an addin, but I don't think this is something I can solve...

Alfa1 11-09-2006 06:27 PM

never mind.


All times are GMT. The time now is 09:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02995 seconds
  • Memory Usage 1,780KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete