I'm Brazilian and I do not speak English very well...
I wanted to know if downloads is possible to modify the order for which is shown in CModsDownload 1.9.6...
I wanted that they were shown oldest first as Default
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
- nestormateo responded to »Fillters in Clip« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Set the orderby=dateA by default .. How make this?
-
- Rank: Helper
- Registered: Jan 29, 2004
- Last visit: Oct 21, 2009
- Posts: 852
You could do that by calling the module with the sortby parameter in the URL defined as dateA
For example:Code
/index.php?name=CmodsDownload&file=index&req=viewdownload&cid=1&orderby=dateA
Alternatively you could hack the module. See file /modules/CmodsDownloads/index.php around line 174. Change:Code
to
Code
If this works maybe you could ask the developer to make it a setting in a new version of the module. For that you can just post a message in the forum of the devs
HTH
BTW Your English isn't that bad at all
-
- Rank: Helper
- Registered: Jan 29, 2004
- Last visit: Oct 21, 2009
- Posts: 852
Sorry, got a bit ahead of myself there..
There's one other location you should edit: /module/CmodsDownloads/dl-navigation.php line 106.
ChangeCode
echo "<td valign=\"top\" width=\"$cmodswidth\" bgcolor=\"#".pnModGetVar('cmodsdownload', 'cmodsbgcolor1')."\" style=\"BORDER-RIGHT: #".pnModGetVar('cmodsdownload', 'cmodsborder2')." 1px solid; BORDER-TOP: #".pnModGetVar('cmodsdownload', 'cmodsborder1')." 1px solid; BORDER-LEFT: #".pnModGetVar('cmodsdownload', 'cmodsborder1')." 1px solid; BORDER-BOTTOM: #".pnModGetVar('cmodsdownload', 'cmodsborder2')." 1px solid\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\"><tr><td><table width=\"100%\" border=\"0\"><tr><td><font class=\"pn-normal\"><strong><img src=\"modules/CmodsDownload/images/cat.gif\" border=\"0\" align=\"middle\" alt=\"\"></strong></font></td><td width=\"100%\"><a href=\"".$GLOBALS['modurl']."&req=viewdownload&cid=$cid&orderby=dateD\"><b>".pnVarPrepForDisplay($title)."</b></a> ";
To
Code
echo "<td valign=\"top\" width=\"$cmodswidth\" bgcolor=\"#".pnModGetVar('cmodsdownload', 'cmodsbgcolor1')."\" style=\"BORDER-RIGHT: #".pnModGetVar('cmodsdownload', 'cmodsborder2')." 1px solid; BORDER-TOP: #".pnModGetVar('cmodsdownload', 'cmodsborder1')." 1px solid; BORDER-LEFT: #".pnModGetVar('cmodsdownload', 'cmodsborder1')." 1px solid; BORDER-BOTTOM: #".pnModGetVar('cmodsdownload', 'cmodsborder2')." 1px solid\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\"><tr><td><table width=\"100%\" border=\"0\"><tr><td><font class=\"pn-normal\"><strong><img src=\"modules/CmodsDownload/images/cat.gif\" border=\"0\" align=\"middle\" alt=\"\"></strong></font></td><td width=\"100%\"><a href=\"".$GLOBALS['modurl']."&req=viewdownload&cid=$cid&orderby=dateA\"><b>".pnVarPrepForDisplay($title)."</b></a> ";
That should do the trick
Good luck! -
- Rank: Helper
- Registered: Jan 29, 2004
- Last visit: Oct 21, 2009
- Posts: 852
What? Giving up already?
Where do you get the wrong sort order (at the "main" page, in a categorie, in a subcategorie) ? -
- Rank: Helper
- Registered: Jan 29, 2004
- Last visit: Oct 21, 2009
- Posts: 852
Well I found one more reference to 'DateD' in the source of the module. It's on line 234 of /modules/CmodsDownloads/dl-viewdownload.php. ChangeCode
if(isset($orderby)) {
$orderby = convertorderbyin($orderby);
} else {
$orderby = convertorderbyin("dateD");
}
to
Code
if(isset($orderby)) {
$orderby = convertorderbyin($orderby);
} else {
$orderby = convertorderbyin("dateA");
}
HTH -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Feb 05, 2006
- Posts: 8
Now it's working!!!
But has a little problem... If I click in the diretorie and then I click in the subdiretorie it's work correctly, but if I click directly in the subdiretorie ( before click on diretorie ) not work, it's showed as before...
Thank so much again! You are really great! -
- Rank: Helper
- Registered: Jan 29, 2004
- Last visit: Oct 21, 2009
- Posts: 852
Mmmh strange. Will have to look into this later. My offline life is calling
I'll let you know in a day or two.....
And you're welcome
-
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Feb 05, 2006
- Posts: 8
\o/\o/ \o/ \o/ \o/
I found the last reference in the "dl-navigation.php"!
Here:
Code
echo "<td align=\"center\"><img src=\"modules/CmodsDownload/images/bullet_b.gif\" align=\"middle\" alt=\"\"></td><td width=\"100%\"><a class=\"pn-normal\" href=\"".$GLOBALS['modurl']."&req=viewsdownload&sid=$sid&orderby=dateD\">".pnVarPrepForDisplay($stitle)."</a> ";
I change to:
Code
echo "<td align=\"center\"><img src=\"modules/CmodsDownload/images/bullet_b.gif\" align=\"middle\" alt=\"\"></td><td width=\"100%\"><a class=\"pn-normal\" href=\"".$GLOBALS['modurl']."&req=viewsdownload&sid=$sid&orderby=dateA\">".pnVarPrepForDisplay($stitle)."</a> ";
Now it's works perfectly!! The dateA is set to default =]
Thanks a Lot ainigma32, you are helped me so much and taught me somethings =D
Bye Now! Thanks a lot again =D -
- Rank: Helper
- Registered: Jan 29, 2004
- Last visit: Oct 21, 2009
- Posts: 852
- Moderated by:
- Support
