Thread Rating:
  • 3 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Links Manager (was Link Manager 2)
#1
This topic is about the GetSimple Links Manager (was Link Manager 2) plugin, an easy to use plugin allowing you to manage a list of links on your website.

I have completed a complete re-write of the code to allow easier maintenance and additions (30/9/13).

Installation

Download the latest version here, unzip the downloaded file and copy its contents to your plugins folder. Please note that because of the name change, if you have an old version of Link Manager 2 you will have to remove that first to avoid a clash.

Usage

Once you've followed the directions described above, You can access the plugin via the Links tab. Click on the Add Link button to start adding new links, change the order of the links by drag & drop.

Either place php code in your theme or template or directly input placeholder tag in an edited page.

Note: The 'display' parameter from the php 'get' calls has been removed. Use 'return' calls instead.

Show all links
* PHP code
Code:
<?php $links_html = return_links(); echo $links_html; ?>
<?php get_links(); ?>
* Page placeholder
Code:
(% links %)

Show links from specific category
The following will show links from category id 3
* PHP code
Code:
<?php $links_html = return_links(3); echo $links_html; ?>
<?php get_links(3); ?>
* Page placeholder
Code:
(% links:3 %)

Show category name
The following will show category name for category id 3
* PHP code
Code:
<?php $category_name = return_category_name(3); echo $category_name; ?>
<?php get_category_name(3); ?>
* Page placeholder
Code:
(% link_category:3 %)

Show a single link by id
The following will show a link with id 7
* PHP code
Code:
<?php $link_html = return_link(7); echo $link_html; ?>
<?php get_link(7); ?>
* Page placeholder
Code:
(% link:7 %)

Show a single link by name
The following will show a link named 'Fred'. This is a case-sensitive exact match.
* PHP code
Code:
<?php $link_html = return_link('Fred'); echo $link_html; ?>
<?php get_link('Fred'); ?>
* Page placeholder
Code:
(% link:Fred %)

Show a random link
The following will show a random link between minimum id 2 and maximum id 9. If only 1 id is used then it is assumed as a maximum with minimum 0. If no id is used then minimum is 0 and maximum is current max id.
* PHP code
Code:
<?php $link_html = return_randlink(2, 9); echo $link_html; ?>
<?php get_randlink(2, 9); ?>
* Page placeholder
Code:
(% randlink:2:9 %)

Search links by keyword
The following will show links with name or description containing 'fish'. This is a case-insensitive search.
* PHP code
Code:
<?php $links_html = return_search_links('fish'); echo $links_html; ?>
<?php search_links('fish'); ?>
* Page placeholder
Code:
(% search_links:fish %)

For example, if you use the vanilla GS Innovation theme, you could add:

Code:
<div class="section linksmanager">
  <h2><?php get_category_name(3); ?></h2>
  <?php get_links(3); ?>
</div>

somewhere between the <aside></aside> tags in the file sidebar.php to show the links from category 3 with appropriate heading in the sidebar section of your site.

There is sample css (links_manager_links.php) included with the plugin which has been tested with Innovation for styling of the links.
Reply
#2
Thanks for creating (or improving) this plugin.

I've found an issue (at least it happens to me). I cannot view the page options when editing a page, unless I disable your plugin. Looks like some conflict with jquery scripts.
Reply
#3
If you don't fill the icon field for a link, it appears in the page source code as:

Code:
<img src="http://" />

If you leave the field empty, then it appears as:

Code:
<img src="" />

Isn't it possible to have links without icons?
Reply
#4
Carlos Wrote:If you don't fill the icon field for a link, it appears in the page source code as:

Code:
<img src="http://" />

If you leave the field empty, then it appears as:

Code:
<img src="" />

Isn't it possible to have links without icons?

Hi Carlos

Thanks for the reports.

I had put an isset($icon) in code but that didn't stop it getting echoed because it was set with empty string!!
Thanks for spotting that.

You shouldn't be able to submit with just "http://" in the icon field.
I get a "Please enter valid URL" error.

Can you confirm that the code is allowing you to submit??
Reply
#5
Carlos Wrote:Thanks for creating (or improving) this plugin.

I've found an issue (at least it happens to me). I cannot view the page options when editing a page, unless I disable your plugin. Looks like some conflict with jquery scripts.

You know I noticed this earlier but being new to GS I thought it was normal operation!! Smile

I only get this when editing a new page. If I am editing a previous page it works ok.

Can you confirm this as well??

Agreed its probably a conflict with jquery. I'm looking into this at the moment.

I'll send update to both fixes once i've found the problem.
Reply
#6
I think the icon and js problems have been fixed.

Version 1.4 has the updates.

Thanks for the feedback.
Reply
#7
Everything ok now.

Wouldn't it be better leaving empty (no http://) the Icon field by default?
Reply
#8
(2012-10-30, 01:35:52)Carlos Wrote: Everything ok now.

Wouldn't it be better leaving empty (no http://) the Icon field by default?

Cool. Thanks for the help.

Yeh initially I had left it blank but it was unclear the the icon field was meant to be a url.

I do agree with you though. If submitting without an icon you first have to delete the text.

I'll change the label for that field and remove the text.
Reply
#9
(2012-10-30, 09:34:47)mrdragonraaar Wrote:
(2012-10-30, 01:35:52)Carlos Wrote: Everything ok now.

Wouldn't it be better leaving empty (no http://) the Icon field by default?

Cool. Thanks for the help.

Yeh initially I had left it blank but it was unclear the the icon field was meant to be a url.

I do agree with you though. If submitting without an icon you first have to delete the text.

I'll change the label for that field and remove the text.

Updated now - version 1.5.
Reply
#10
I actually created a forum account specifically to reply to this but since I use get simple anyway I guess its for the best ha.

I just had a small suggestion to increase accessibility from the admin.

All those instructions that are posted in here with the template tags etc. How about creating a button in the admin of the link manager that just has references to all those tags built in.

Makes it a little more integrated than having to flip to a forum thread for usage instruction.

Know alot of plugins have a button like that built in and if I was better at PHP id just do a copy and paste job myself but it was just a thought. Havent even used the plugin yet but from the looks of it its exactly what I was looking for to manage footer links for my clients.
Reply
#11
Nice plugin - improvement over the simple Link Manager, but I have a question. I can display the links by category, no problem, but I didn't see anywhere on this thread how one would go about displaying the Description for each link?

(% links:2 %) just shows the links for category 2... I've tried several different variations of that to try to get the descriptions to show, but to no avail. Please help...

thanks,

Roberta
Reply
#12
Never mind - I figured it out. There is a problem with the link template file (links_html.php), it was displaying the description as a link title in the a code but not as a description itself. I added a line to display the description beneath the bullet, and now it works:

line:
<?php if (isset($link->desc) && $link->desc) { ?><br><?php echo $link->desc; ?><?php } ?>

entire page (as modified):

<?php
/**
* Link Manager 2 template for links html list.
*
* ©2012 mrdragonraaar.com
*/
if (!defined('IN_GS')) { die('you cannot load this page directly.'); }

?>
<ul>
<?php
foreach ($lm2->links() as $link)
{
if (!isset($category_id) || !is_int($category_id) ||
($category_id == $link->category))
{
?>
<li><a <?php if (isset($link->desc) && $link->desc) { ?>title="<?php echo $link->desc; ?>"<?php } ?> <?php if (isset($link->target) && $link->target) { ?>target="<?php echo $link->target; ?>"<?php } ?> href="<?php echo $link->url; ?>"><?php if (isset($link->icon) && $link->icon) { ?><img src="<?php echo $link->icon; ?>" /><?php } ?><?php echo $link->name; ?></a>


<?php if (isset($link->desc) && $link->desc) { ?><br><?php echo $link->desc; ?><?php } ?>


</li>
<?php
}
}
?>
</ul>
Reply
#13
Is there anyway to search the xml file and show links, not by category, but by chosen words in the title or description?

This would be most useful, especially when you get up over 10 categories and 200 links.

MTW
Reply
#14
I have two issues:

When I created a link with an icon url specified this url is automatically removed when I try to edit the link again.


The second is more a question:

How do I remove the link text (Name) so that I only see the icon displayed?

See attachment for example
Reply
#15
Maybe you can add the option to not post every link in a new line. So you get kind of a link-cloud look.
Reply
#16
(2013-02-21, 08:14:14)datiswous Wrote: I have two issues:

When I created a link with an icon url specified this url is automatically removed when I try to edit the link again.


Edit_link_panel.php has an echo missing

Line 72 I think it is...

<input class="text url" name="link-icon" id="link-icon" type="text" value="<?php if (isset($link)) { echo $link->icon; } ?>" />
Reply
#17
(2013-06-28, 08:11:16)mtw Wrote:
(2013-02-21, 08:14:14)datiswous Wrote: I have two issues:

When I created a link with an icon url specified this url is automatically removed when I try to edit the link again.


Edit_link_panel.php has an echo missing

Line 72 I think it is...

<input class="text url" name="link-icon" id="link-icon" type="text" value="<?php if (isset($link)) { echo $link->icon; } ?>" />

Thanks! It worked!
Reply
#18
In case anyone is interested, I have adapted code (hope you don't mind) and implemented

(% randlink:50 %)

which will choose a random link from the first 50 and show it on a page.

If interested, PM me.
Reply
#19
Haven't checked in for a long time and have just read the comments.
Can't believe the amount of downloads for this!!

I've updated the plugin to address some of the comments ...
v1.6
* Corrected the problem with icon url disapearing on edit link page.
* Added ability to only display icons or text on a per category basis.
* Added ability to show description on a per category basis.
Reply
#20
Another update.

v1.7
* When displaying All Links the links obey the category display options.
* Added sample css. Works with Innovation theme (linkmanager2_links.css). Enabled by default. To disable comment out the last 2 lines of linkmanager2.php. To use enclose links in <div class="linkmanager2"> tags.
* Added single link.
Template tag (get link 3)
Code:
(% link:3 %)
or php call
Code:
get_link(3);
$link_html = get_link(3, false);
* Added random link (thanks to mtw for code)
Template tag (get random link between 0 and 10)
Code:
(% randlink:10 %)
or php call
Code:
get_randlink(10);
$randlink_html = get_randlink(10, false);
Reply
#21
I've actually moved to another plugin, because your plugin did not seam maintained anymore and I had some issues (which you seemed to have fixed in v.1.6) Although now this seams to be the case with that plugin as well.
I will test the changes from your plugin.
Reply
#22
(2013-09-23, 11:13:36)datiswous Wrote: I've actually moved to another plugin, because your plugin did not seam maintained anymore and I had some issues (which you seemed to have fixed in v.1.6) Although now this seams to be the case with that plugin as well.
I will test the changes from your plugin.

Yeh. Sorry about that. To be honest I forgot about it Smile
For some reason I stopped getting notification emails as well.

Hopefully the changes are ok for you.
Reply
#23
Another quick update by request.

v1.8
* Added a single case-insensitive keyword search of the link name and description.
To display links with "fish" in title or description.
Code:
search_links('fish');
$search_html = search_links('fish', false);

or

Code:
(% search_links:fish %)
Reply
#24
(2013-09-23, 14:35:28)mrdragonraaar Wrote:
(2013-09-23, 11:13:36)datiswous Wrote: I've actually moved to another plugin, because your plugin did not seam maintained anymore and I had some issues (which you seemed to have fixed in v.1.6) Although now this seams to be the case with that plugin as well.
I will test the changes from your plugin.

Yeh. Sorry about that. To be honest I forgot about it Smile
For some reason I stopped getting notification emails as well.

Hopefully the changes are ok for you.

Hey, no problem, glad you're back. Saw there's a v.1.8. What are the changes?

Tested it. Kind of gives the same output as the custom menu plugin from Angryboy (I mentioned it before), but it has a different (I think simplified, but less organised) approach. Less organised in the way that it kind of is made for only one list, but with categories you can make multiple lists, but it still is shown as one list in admin.

I thought the following would be good additions:
  • ability to also set links to internal pages.
  • ability to not set url.
  • have a larger description box.
  • show category id with category name in Manage Links page.

At the moment setting the url is a requirement, but it seems that link manager can also be used to make simple lists of text with image. See a test of mine (not properly styled): test (the image is the link, but should't have to)
Reply
#25
(2013-09-24, 09:45:19)datiswous Wrote: Hey, no problem, glad you're back. Saw there's a v.1.8. What are the changes?

Thanks. I don't do a lot of coding these days so I only tend to if I have some spare time.
v1.8 included an update that allowed a simple keyword search of the links.
Details are in the post just above yours.

(2013-09-24, 09:45:19)datiswous Wrote: Tested it. Kind of gives the same output as the custom menu plugin from Angryboy (I mentioned it before), but it has a different (I think simplified, but less organised) approach. Less organised in the way that it kind of is made for only one list, but with categories you can make multiple lists, but it still is shown as one list in admin.

I had a look at Angryboy's plugin. It's nice. As you say it provides different functions although can have similar look on the page.
I started this as an update to an existing plugin after using wordpress for years which had a link manager built it.

(2013-09-24, 09:45:19)datiswous Wrote: I thought the following would be good additions:
  • ability to also set links to internal pages.
  • ability to not set url.
  • have a larger description box.
  • show category id with category name in Manage Links page.

At the moment setting the url is a requirement, but it seems that link manager can also be used to make simple lists of text with image. See a test of mine (not properly styled): test (the image is the link, but should't have to)

I never gave that a thought Smile

I updated with 3 of your suggestions.

v1.9
* url is now not required. If left blank no <a> tags are used but instead a <span> tag is used to seperate the link data from the description. The sample css is updated to give same display as before.
* changed description box to textarea. If newlines are entered for description then they are converted to <br> tags if description is displayed.
* category id is now displayed in manage links page.

There were also a couple of fixes. The front-end css was overiding the back-end css.

Your other suggestion with drop down for internal pages will take a bit more time.

Let me know if you find any errors.
Reply




Users browsing this thread: 1 Guest(s)