vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Major Additions - DownloadsII (https://vborg.vbsupport.ru/showthread.php?t=120122)

DemoVFW 12-13-2008 09:33 PM

Quote:

Originally Posted by carrlos (Post 1672317)
I'm having this same issue and I see that others are having it too. Why can't we get some support on this??? :mad:

You can fix this issue (the security token problem) by editing or creating a PHP.ini file. I had the same problem and saw that it was answered on page 200 of this thread. See below (edit the "post_max_size" to a larger size then 8M). Worked for me.

Quote:

Originally Posted by lilP
Thanks columbusgeek. After your reply my co-worker and I checked what you had told us, but after testing found out it wasn't it. It was actually the post_max_size was set at 8M. As soon as we changed it to 100M, it started to work with bigger files.
Thanks again for your help. Much appreciated.


SeanMT 12-13-2008 09:47 PM

1 Attachment(s)
I've managed to create a simple RSS feed for mine. You just need to create 3 files.

Mine can be seen working by clicking the large RSS button here

The code for the files follow:


rss.php
PHP Code:

<?php 

error_reporting
(E_ALL); 

$siteURL "http://" $_SERVER['HTTP_HOST']; 
$feedTitle "FM-Base.co.uk - Latest FM2009 Downloads"
$rssVersion 2.0

function 
generateFeed $homeURL$title$version 2.0) { 
// a little check for the arguments thrown in. 
if (func_num_args() < 2
exit (
"Insufficant Parameters"); 

include 
'config.php';
include 
'opendb.php'

// only select the columns you need, thus reducing the work the DBMS has to do. 
$query "SELECT name, description, date, id, purgatory FROM vb3_dl_files WHERE purgatory = 0 ORDER BY id DESC LIMIT 5";
// execute the query 
$results mysql_query ($query) or exit(mysql_error()); 

// check for the number of rows returned before doing any further actions. 
if (mysql_num_rows ($results) == 0){ 
exit(
"Nothing to Show Here"); 


else { 
$rss ""
// tell the browser we want xml output by setting the following header. 
header("Content-Type: text/xml; charset=utf-8"); 

// set the xml document properties and tell it a location of a stylesheet. 
$rss .= "<?xml version=\"1.0\" ?>\r\n";

// set the RSS version using the version parameter 
$rss .= "<rss version=\"$version\">\r\n"

// each RSS feed has a channel and a title, Using the title parameter we set the title of the feed. 
$rss .= "<channel>\r\n"
$rss .= "<title>" ucwords($title) . "</title>\r\n"

while (
$row mysql_fetch_array($results)){ 

$rss .= "<item>\r\n"
$rss .= "<title>" $row['name'] . " (" date("d/m/y"$row['date']) . ") </title>\r\n"
$rss .= "<description>" stripslashes(trim($row['description'])) . "</description>\r\n"

$rss .= "<link>" "http://www.fm-base.co.uk/forum/downloads.php?do=file&amp;id=" $row['id'] . "</link>\r\n"

$rss .= "</item>\r\n\r\n"



$rss .= "</channel>\r\n"
$rss .= "</rss>\r\n"

echo 
$rss




// call the function with all our settings from the top of the script 
generateFeed$siteURL $feedTitle$rssVersion ); 

?>

config.php
PHP Code:

<?php
$dbhost 
'localhost';
$dbuser 'root';
$dbpass '';
$dbname 'downloads';
?>

opendb.php
PHP Code:

<?php
$conn 
mysql_connect($dbhost$dbuser$dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);
?>

Oh and if you want you may use the RSS button I made (attached).

Attachment 90559

d2sector 12-13-2008 11:08 PM

Is this working with v3.8?
I see http://www.minatica.be/downloads.php is running V6. When will that be released?

Digital Jedi 12-14-2008 02:33 AM

Quote:

Originally Posted by SeanMT (Post 1684813)
I've managed to create a simple RSS feed for mine. You just need to create 3 files.

Mine can be seen working by clicking the large RSS button here

The code for the files follow:


rss.php
PHP Code:

<?php 
 
error_reporting
(E_ALL); 
 
$siteURL "http://" $_SERVER['HTTP_HOST']; 
$feedTitle "FM-Base.co.uk - Latest FM2009 Downloads"
$rssVersion 2.0
 
function 
generateFeed $homeURL$title$version 2.0) { 
// a little check for the arguments thrown in. 
if (func_num_args() < 2
exit (
"Insufficant Parameters"); 
 
include 
'config.php';
include 
'opendb.php'
 
// only select the columns you need, thus reducing the work the DBMS has to do. 
$query "SELECT name, description, date, id FROM vb3_dl_files ORDER BY id DESC LIMIT 5"
// execute the query 
$results mysql_query ($query) or exit(mysql_error()); 
 
// check for the number of rows returned before doing any further actions. 
if (mysql_num_rows ($results) == 0){ 
exit(
"Nothing to Show Here"); 

 
else { 
$rss ""
// tell the browser we want xml output by setting the following header. 
header("Content-Type: text/xml; charset=utf-8"); 
 
// set the xml document properties and tell it a location of a stylesheet. 
$rss .= "<?xml version=\"1.0\" ?>\r\n";
 
// set the RSS version using the version parameter 
$rss .= "<rss version=\"$version\">\r\n"
 
// each RSS feed has a channel and a title, Using the title parameter we set the title of the feed. 
$rss .= "<channel>\r\n"
$rss .= "<title>" ucwords($title) . "</title>\r\n"
 
while (
$row mysql_fetch_array($results)){ 
 
$rss .= "<item>\r\n"
$rss .= "<title>" $row['name'] . " (" date("d/m/y"$row['date']) . ") </title>\r\n"
$rss .= "<description>" stripslashes(trim($row['description'])) . "</description>\r\n"
 
$rss .= "<link>" "http://www.fm-base.co.uk/forum/downloads.php?do=file&amp;id=" $row['id'] . "</link>\r\n"
 
$rss .= "</item>\r\n\r\n"
 

 
$rss .= "</channel>\r\n"
$rss .= "</rss>\r\n"
 
echo 
$rss
 


 
// call the function with all our settings from the top of the script 
generateFeed$siteURL $feedTitle$rssVersion ); 
 
?>

config.php
PHP Code:

<?php
$dbhost 
'localhost';
$dbuser 'root';
$dbpass '';
$dbname 'downloads';
?>

opendb.php
PHP Code:

<?php
$conn 
mysql_connect($dbhost$dbuser$dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);
?>

Oh and if you want you may use the RSS button I made (attached).

Attachment 90559

Consider releasing that as an add-on for the mod.

tlwwolfseye 12-14-2008 11:21 AM

Is it possible that bigger files (couple hundred MB) take a very long time as download to start ? I just noticed that today. Or is there anything that can be done to make that faster ? Isn?t normal for Download Scripts generally, even with big files.

I installed MEMCACHE on my Server, was already not so easy when you?re no Linux freak. ;) Anyways, that works and I got a bit less drain on the CPU now but still, the time it takes before a bit bigger files actually start and you got the SAVE AS window, takes far too long. And thats just with me testing, imagine 20 people do that at the same time, don?t want to know whats going on then.

Any ideas why this script takes so long time with bigger files to actually start downloading ?

SeanMT 12-14-2008 05:12 PM

I've made a slight change to the RSS feed above. I have edited line 18. The RSS feed will now only show files that have been approved.

Quote:

Originally Posted by Digital Jedi (Post 1684935)
Consider releasing that as an add-on for the mod.

I would but I don't have the time to provide support for it.

Stifmeister2 12-14-2008 10:41 PM

Quote:

Originally Posted by SeanMT (Post 1685339)
I've made a slight change to the RSS feed above. I have edited line 18. The RSS feed will now only show files that have been approved.



I would but I don't have the time to provide support for it.

There are many unsupported mods here. If you think it works well, you could release it and let it up to others to decide whether it's worth installing. ;)

tlwwolfseye 12-17-2008 07:41 AM

Ok, i think i know why this Mod is taking such a huge CPU load when using very big Files (couple hundred MB or even 1 GB or more). There are 2 ways to add files. One is uploading (adding manually) which is fine for smaller files but of course overkill with File sizes over 1 GB or so.

For that the Import function seems to be there. But, this Import function kinda makes the imported Files downloadable as stream. Which means as far as I know, anytime someone starts a download, the file will be copied from its original location and made ready for the Download. That way making it impossible to get the original Location. Problem is, anytime a download starts to copy for example a file over 1 GB is madness, thats why the CPU is going up in usage beyond normal. If many people would download that file at the same time the Webserver probably would collapse.

So the only way to add files that are that big is with manually adding a file as if one would upload it but then not to upload from the own PC but to enter the link (direct) to the File. Then the download wouldn?t start as stream but get the file from the link entered and works fast. Only problem is, that way the direct link location of that file is easy to find out in the Browser and can be used without actually going through the Website. :(

MrEyes 12-19-2008 08:57 AM

Just downloaded and installed this on my test site and all it well, extremely easy to setup and use.

Anyway, I have found one small problem....

One of the templates (editor_css) isn't cached so an unnecessary SQL call is perform. The fix for this is extremely easy:
  1. Get your downloads.php file and open it in your favourite text editor
  2. Find the following line@
    Code:

    'file' => array(
    this should be around line 95
  3. Immediately after this line enter the following (exactly as it appears here):
    Code:

    'editor_css',
    You should now have something that looks like this:
    Code:

    ),
    'file' => array(
            'editor_css',
            'downloads_file',
            'downloads_file_addit',

  4. Save the file and reupload to your server

EDIT: You also need to follow these same steps for the "'add' => array(" section

Job done

There is also another feature that might prove to be somewhat annoying to end users. Lets say UserX decides to upload a file, the enter the filename, author, a really long and informative description, the file path but forgets to choose a category. They then click submit and they will get the "complete the sections marked in red" message.

The problem is that it seems the contents of the description/filepath are lost so they have to retype it all or hope that clicking back will get their description back.

tlwwolfseye 12-19-2008 09:43 AM

But this doesnt change the high CPU load with the import or starting a download which is quite large, right ? Because i think that is the result of the streaming that this Mod is working with.

Wolfseye


All times are GMT. The time now is 08:59 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.03527 seconds
  • Memory Usage 1,828KB
  • 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
  • (3)bbcode_code_printable
  • (6)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (6)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