Joomler!.net - Decided on Joomla!

デル株式会社

Wiki or Wordpress? No it is JContentPlus.

Latest Posts

Requiring a login
Avatar abrill 2010/07/07 05:06
We created a new category, added links to it, and it asks for login after clicking on those links...
Re:Display weblinks in a nice table-grid - AllWeblinks plugin and module
Avatar rexkramer 2010/05/28 06:28
Hi, i really do like this one for a joomla core replacement (addition): http://extensions.jooml...
Adding a readmore link to mod_ weblink info
Avatar Jet 2010/05/20 01:02
Hi there. I really like your Weblink Info module. It would be perfect for me except I want to se...
How can one change the display order to a horizontal way?
Avatar a7tx42 2010/04/22 00:28
I’m struggling of how to display the links in horizontal order instead of vertical order. A put...
Re:Where can I change the link title size?
Avatar leeue 2010/03/30 17:14
Thanks for your reply. I added your two lines to the template css, and added _weblinkinfo to the...

Popular Posts

ja purity template - need to customize css
Avatar webrp 2008/12/20 13:06
hi 1st of all thank you for this usefull module! I love this thumbnail feature. I have it o...
weblink does not display
Avatar insight 2009/02/20 09:40
hi I am using weblink module based on Joomla 1.5.9, but I cannot see this module works on my s...
WebLink Info New Version(Test)
Avatar Joomler! 2008/09/23 09:05
少し前に作成してあって放置していたものです。 旧バージョンとの違い 並び順に指定順を追加 カラム数を指定し横並びもできる なぜ、ここかというとちゃんと確認していな...
showing the links in a different order than avail.
Avatar posternb 2008/09/13 18:17
Hi there. I would like to have my links show in the backend order, instead of random, new, or mo...
Wrapper
Avatar Lexchess 2009/11/05 06:41
Is there a way to display your links in a Joomla 1.5 wrapper when they are clicked?

Forum Stats

All times are UTC + 9 hours
Total Topics:201
Total Posts:1137
New Members:
Avatar JimJo

Forum Online

Total Online:68
Total Guest:68
Bottom
Home » Support » Modules » Free Module » WebLinkInfo » showing the links in a different order than avail.
showing the links in a different order than avail.
showing the links in a different order than avail.
Saturday, 13 September 2008 18:17
0 votes
Hi there. I would like to have my links show in the backend order, instead of random, new, or most hits. If I wanted to hack the code and change one of the options to show that order, what would I change it to?

Here''s the code I assume I want to change, from ''helper.php'', line #52:

switch($type){
            case 1:
                $order = "
 ORDER BY w.hits DESC, c.ordering ASC";
                break;
            case 2:
                $order = "
 ORDER BY RAND(), c.ordering ASC";
                break;
            default:
                $order = "
 ORDER BY w.date DESC, c.ordering ASC";
        }


Now, I realize that I can change one of the cases so that if I chose that option, the new code would execute instead. So, lets say I know I will never use ''hits", I could change the code for ''case 1'' to show the backend order, and select "Hits" from the menu.

So how would I change the line of code to show that order?

Thanks for your help!

Cheers.
posternb
Fresh Boarder
Fresh Boarder
2
2008/09/14
Re:showing the links in a different order than avail.
Sunday, 14 September 2008 08:47
0 votes
hi,
Thank you for use it.

Please change as follows.

mod_weblinkinfo.xml
<option value="0">New WebLink</option>
<option value="1">Most Hits WebLink</option>
<option value="2">Random WebLink</option>


to

<option value="0">New WebLink</option>
<option value="1">Most Hits WebLink</option>
<option value="2">Random WebLink</option>
<option value="3">Ordering Asc</option>
<option value="4">Ordering Desc</option>


helper.php
switch ($type) {
	case 1:
		$order = "
 ORDER BY w.hits DESC, c.ordering ASC";
		break;
	case 2:
		$order = "
 ORDER BY RAND(), c.ordering ASC";
		break;
	default:
		$order = "
 ORDER BY w.date DESC, c.ordering ASC";
}


to

switch ($type) {
	case 1:
		$order = "
 ORDER BY w.hits DESC, c.ordering ASC";
		break;
	case 2:
		$order = "
 ORDER BY RAND(), c.ordering ASC";
		break;
	case 3:
		$order = "
 ORDER BY w.ordering ASC, c.ordering ASC";
		break;
	case 4:
		$order = "
 ORDER BY w.ordering DESC, c.ordering ASC";
		break;
	default:
		$order = "
 ORDER BY w.date DESC, c.ordering ASC";
}


It adds it by the upcoming version.

Thanks
Joomler!
Platinum Boarder
Platinum Boarder
477
2007/08/26
Re:showing the links in a different order than avail.
Tuesday, 21 October 2008 05:43
0 votes
Thank you for your excellent plugin. I would also like the links to show by the administrator backend order, so I look forward to your new version.

In the meantime I will use the code you provided here.

Regards

Rowby
rowby
Fresh Boarder
Fresh Boarder
2
2008/10/21
Re:showing the links in a different order than avail.
Tuesday, 21 October 2008 06:12
0 votes
Hi

I just tried making the changes, but when I tried to install the new file (I extracted it all back into a zip file and uploaded it I got this error from Joomla 1.5.7

Unable to write entry

Warning: file_put_contents(/home/military/public_html/tmp/install_48fcf27b0919c/tmpl/default.php) [function.file-put-contents]: failed to open stream: No such file or directory in /home/military/public_html/libraries/joomla/filesystem/file.php on line

I double checked the code and I am 99 percent certain I copied and pasted it according to your instructions.

Is there any way you can create a new zip file that would include your modifications so we can display by the other ordering options.

Thank you!

Rowby
rowby
Fresh Boarder
Fresh Boarder
2
2008/10/21
Re:showing the links in a different order than avail.
Tuesday, 21 October 2008 06:40
0 votes
Try just dropping your altered php file on top of the existing file after a fresh install. No need to reinstall the entire package after every small change you make to the code. It sounds like you''ll need to do so due to the problems you''ve had, but for future reference, you needn''t usually reinstall a package after making these minor changes.

For now, uninstall the extension, then go into your ftp client and browse into your Joomla installation, and make sure that the mod_weblinkinfo folder is completely gone. Then go back in and reinstall the original package. That puts you back into a normal installation status.

Now, you can just drop your altered php file right on top of the old one (better yet, change the name of the original file by putting a ''_'' at the beginning to make a backup). Now, the new code will be executed instead of the old code. And if you make a mistake, you can just undo your changes, re-save the file, drag your new save over the one online, test again, etc. And if all else fails, you can always delete it and rename the backup to its original name to restore the code to its original glory.

Anyway, I hope my explanation was clear, and I didn''t rush over too much. That should help you at least work out. I''ll leave more detailed advice for the module''s creator, as he''ll be more informed about its inner workings. I know I couldn''t help you with the code itself, but hopefully my advice will make the hacking/testing process a bit easier on you, and you won''t have to deal with the installer anymore once you get the basic extension installed clean.

Good luck! Cheers.
posternb
Fresh Boarder
Fresh Boarder
2
2008/09/14
 
Home » Support » Modules » Free Module » WebLinkInfo » showing the links in a different order than avail.
joomler.net is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla!(R) name is used under a limited license from Open Source Matters in the United States and other countries.
joomler.net is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.