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)

ragtek 05-15-2007 02:48 PM

Quote:

Originally Posted by CyberRanger (Post 1247974)
RS_Jelle and I have commented about a "points" integration in the past but let me re-summarize what we plan to do.

A minor version or so ago, we started introducing hooks into downloads.php. With the next version, we ensure that there are hooks in all the necessary places for any programmer to write an add-on to integrate any "points" system with DownloadsII. That programmer may or may not be me or Jelle.

But, we won't be coding downloads.php itself for one specific "points" program. We will be coding it to be open for anyone who is willing to take the time to write the add-on.

sounds fine

rabbits slayer 05-15-2007 03:25 PM

Without going through 80+ pages, my category sorting is by date added...any help on getting it to A to Z?

Sort by Weight is already set to off.

TrIn@dOr 05-15-2007 03:46 PM

If u want i can do the spanish XML (i can translate, but give me the piece code)

CyberRanger 05-15-2007 04:25 PM

Quote:

Originally Posted by rabbits slayer (Post 1248169)
Without going through 80+ pages, my category sorting is by date added...any help on getting it to A to Z?

Sort by Weight is already set to off.

Do you mean your file listing is by date added? I don't think the categories even have a date added field.

If you want to change the default order for how the files are listed, in downloads.php around line 291 -

FIND:
PHP Code:

    if ($sortfield == '')
    {
        
$sortfield 'date';
    } 

CHANGE TO:
PHP Code:

    if ($sortfield == '')
    {
        
$sortfield 'name';
    } 


Jay... 05-15-2007 04:36 PM

i have a problem, i have uploaded over 300 files to a folder on my server, i am trying to import them using the tool on the amdincp. the Downloads are not showing in alphabetical order (on the import page) like they used to. this is causing me quite a bit of hassle

CyberRanger 05-15-2007 04:38 PM

Quote:

Originally Posted by Jay... (Post 1248221)
the Downloads are not showing in alphabetical order like they used to. this is causing me quite a bit of hassle

Where are they not showing in alphabetical order???

Jay... 05-15-2007 04:41 PM

Quote:

Originally Posted by CyberRanger (Post 1248223)
Where are they not showing in alphabetical order???

sorry i just edited my last post. they are not showing up on the import page. the order seems quite random

CyberRanger 05-15-2007 04:54 PM

Quote:

Originally Posted by Jay... (Post 1248225)
sorry i just edited my last post. they are not showing up on the import page. the order seems quite random

I'm afraid I don't really have an answer you'll like. The directory is being read with a standard php readdir function. From the php manual: [readdir] returns the filename of the next file from the directory. The filenames are returned in the order in which they are stored by the filesystem. So, unless we build all the names into an array, then sort the array, we are at the mercy of how your underlying filesystem presents the files.

Jay... 05-15-2007 04:55 PM

Quote:

Originally Posted by CyberRanger (Post 1248235)
I'm afraid I don't really have an answer you'll like. The directory is being read with a standard php readdir function. From the php manual: [readdir] returns the filename of the next file from the directory. The filenames are returned in the order in which they are stored by the filesystem. So, unless we build all the names into an array, then sort the array, we are at the mercy of how your underlying filesystem presents the files.

i never used to have this problem, i just installed the latest version of your hack :confused:

CyberRanger 05-15-2007 05:09 PM

Quote:

Originally Posted by Jay... (Post 1248236)
i never used to have this problem, i just installed the latest version of your hack :confused:

beats me! But, if you want to ensure the files on the mass import screen are in A - Z order, do this:

in admincp/downloadadmin.php around line 292

FIND:
PHP Code:

while (false !== ($file readdir($handle)))
        {
            if (
is_file($_POST['dir'].$file) AND strstr("|".str_replace(" ","|",$dl->ext)."|",strtolower(substr($filestrrpos($file'.')+1))))
            {
                
$file str_replace(array("[","]"),array("(openbracket)","(closebracket)"),$file);
                
$class fetch_row_bgclass();
                echo 
'<tr><td class="'.$class.'">'.$file.'</td><td class="'.$class.'"><input type="text" size="20" name="dname['.$file.']" /></td><td class="'.$class.'"><input type="text" size="20" name="author['.$file.']" /></td><td class="'.$class.'"><input type="text" size="20" name="desc['.$file.']" /></td><td class="'.$class.'"><select name="category['.$file.']">'.$category_select.'</select></td><td class="'.$class.'"><select name="pinned['.$file.']"><option value="-1">-----</option><option value="0">No</option><option value="1">Yes</option></select></td><td class="'.$class.'"><input type="checkbox" name="import['.$file.']" value="1" /></td></tr>';
            }
        }
        
closedir($handle); 

REPLACE with
PHP Code:

        $files = array();
        
        while (
false !== ($file readdir($handle)))
        {
            if (
is_file($_POST['dir'].$file) AND strstr("|".str_replace(" ","|",$dl->ext)."|",strtolower(substr($filestrrpos($file'.')+1))))
            {
                
array_push($files$file);
            }
        }
        
closedir($handle);
        
sort($files);
        
        foreach (
$files as $file) {
                
$file str_replace(array("[","]"),array("(openbracket)","(closebracket)"),$file);
                
$class fetch_row_bgclass();
                echo 
'<tr><td class="'.$class.'">'.$file.'</td><td class="'.$class.'"><input type="text" size="20" name="dname['.$file.']" /></td><td class="'.$class.'"><input type="text" size="20" name="author['.$file.']" /></td><td class="'.$class.'"><input type="text" size="20" name="desc['.$file.']" /></td><td class="'.$class.'"><select name="category['.$file.']">'.$category_select.'</select></td><td class="'.$class.'"><select name="pinned['.$file.']"><option value="-1">-----</option><option value="0">No</option><option value="1">Yes</option></select></td><td class="'.$class.'"><input type="checkbox" name="import['.$file.']" value="1" /></td></tr>';
        } 



All times are GMT. The time now is 03:16 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.04454 seconds
  • Memory Usage 1,782KB
  • 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
  • (4)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
  • (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