https://www.icyphoenix.com/viewtopic.php?f=2&t=9624
-----------------------------------
MWE_001
Thu 11 Aug, 2016 02:56

Links Plugin Errors And Fixes
-----------------------------------
I had posted in another thread which not so smart to do. I am going to consolidate it all here. The original was [url=http://www.icyphoenix.com/viewtopic.php?f=40&t=9615]Here.

[quote]The links plugin, if you put your site info in the ACP and click submit, it does not seem to save the submitted info? If you go to the links page on your website and then copy the html to a clipboard to "link to our site" it copies all the html code, but under further review, it is not injecting the websites url so basically, that renders it useless.[/quote]

That is part of my original post. Here is the updated version:

Links Plugin

When entering your site information in the config of the ACP, the ACP would save all info BUT the site logo url and the website url.
When viewing the link to us section on the links page the html worked great MINUS the site url and no logo would be injected in to the code. Example it would say :

[code linenumbers=false]<a href="" target="_blank"><img src="" width="100" height="31" alt="What ever your site is" /></a>[/code]

Now the obvious problem with this is, the person linking back to your site would have bogus code. It would be useless without the image and url back to your website.

Problem solved!

I looked in the database and sure enough, in the ip_links_config table, the site_url and site_logo entries were missing thus the info was not being stored in the database.

To fix it:

OPEN [b]plugins/links/install/install.php[/b]
FIND
[codeblock]"INSERT INTO `" . $table_prefix . "link_categories` (`cat_id`, `cat_title`, `cat_order`) VALUES (8, 'News', 8);",[/codeblock]
AFTER ADD
[codeblock]
"INSERT INTO `" . $table_prefix . "link_config` (`config_name`, `config_value`) VALUES ('site_logo', 'Site Logo URL Here');",
"INSERT INTO `" . $table_prefix . "link_config` (`config_name`, `config_value`) VALUES ('site_url', 'Your Site URL Here');",
[/codeblock]

EOM Close and save all files.

To fix a already working website (live production or test environment):

Enter ACP/DB and Security/IPMySQLAdmin

a new page will open. In the little box it says Query your Database: SQL  and a yellow light bulb. Click the SQL Icon

It will open a box. In this box insert the following:

[code linenumbers=false]
"INSERT INTO `" . $table_prefix . "link_config` (`config_name`, `config_value`) VALUES ('site_logo', 'Site Logo URL Here');",
"INSERT INTO `" . $table_prefix . "link_config` (`config_name`, `config_value`) VALUES ('site_url', 'Your Site URL Here');",
[/code]

Now press, submit Query. Wah lah! Your links plugin is now fixed. On the links.php page, your members will now see your site logo and when they copy the html to place on their site, all pertinent site info will be in place properly in the code ready for use.

Here is the screenshots:

This shows the missing fields in the database.
 [img]http://www.icyphoenix.com/files/images/11665/screenshot_8.jpg[/img]

The next one shows the fields not saved after submission.

 [img]http://www.icyphoenix.com/files/images/11665/screenshot_9.jpg[/img] 

This one is of it fixed:

 [img]http://www.icyphoenix.com/files/images/11665/screenshot_10.jpg[/img]

Enjoy folks! As always, these fixes are not final. The final say is up to MG himself. This is what worked for me.


-----------------------------------
Mighty Gorgon
Sat 20 Aug, 2016 23:40

Re: Links Plugin Errors And Fixes
-----------------------------------
Great suggestion and fix... I have implemented it on my local package... and I'll update on GIT on next commit.

Thank you very much.


-----------------------------------
MWE_001
Sun 21 Aug, 2016 04:51

Re: FIXED Links Plugin Errors And Fixes
-----------------------------------
No problem at all. Glad I was actually able to help and contribute to the community. I appreciate your including my fix.


