The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 3 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Links Manager (was Link Manager 2)
#46
Having become curious about the code because of your last reply, I had a look at it and holy..
I could barely believe the size & complexity of the codebase for something as basic as 'managing links'.

The plugin exposes a global $lm_links, but all properties are protected so no way to get the raw data, unless you modify the core with your own return function, or change existing ones.

I also noticed that the plugin is not compatible with PHP 5.2.x and under (it should mention PHP 5.3+). The preg_replace_callback functions in the functions.php file use an anonymous function while it should be a reference by string name for compatibility. See http://php.net/manual/en/function.preg-replace-callback.php#109248.

EDIT: fiddled with it. as a quick hack for returning a link category, go to links_manager/inc/Links.php, and on line 83, change the private keyword to public, then add the following code in links_manager/functions.php:

PHP Code:
function return_links_raw($catId) {
    global 
$lm_links;
    return 
$lm_links->get_by_category($catId);

This will return an array of Link objects for that categoryId, eg you'd access the first link in the first category's url like this: $link = return_links_raw(0)[0]->url.
Reply


Messages In This Thread
RE: Link Manager 2 - by bhwebco - 2012-12-06, 04:39:22
RE: Link Manager 2 - by grassfrog - 2012-12-30, 18:17:55
RE: Link Manager 2 - by grassfrog - 2013-01-05, 07:45:33
RE: Link Manager 2 - by mtw - 2013-02-06, 21:03:08
RE: Link Manager 2 - by datiswous - 2013-02-21, 08:14:14
RE: Link Manager 2 - by mtw - 2013-06-28, 08:11:16
RE: Link Manager 2 - by datiswous - 2013-06-29, 09:37:07
RE: Link Manager 2 - by datiswous - 2013-02-22, 10:17:35
RE: Link Manager 2 - by mtw - 2013-06-30, 15:42:34
RE: Link Manager 2 - by mrdragonraaar - 2013-09-21, 07:34:21
RE: Link Manager 2 - by mrdragonraaar - 2013-09-22, 23:15:19
RE: Link Manager 2 - by datiswous - 2013-09-23, 11:13:36
RE: Link Manager 2 - by mrdragonraaar - 2013-09-23, 14:35:28
RE: Link Manager 2 - by datiswous - 2013-09-24, 09:45:19
RE: Link Manager 2 - by mrdragonraaar - 2013-09-24, 19:53:46
RE: Link Manager 2 - by mrdragonraaar - 2013-09-24, 08:36:11
RE: Link Manager 2 - by mrdragonraaar - 2013-09-25, 12:27:43
RE: Link Manager 2 - by datiswous - 2013-09-27, 04:50:23
RE: Link Manager 2 - by mrdragonraaar - 2013-09-30, 10:21:28
RE: Links Manager (was Link Manager 2) - by mtw - 2013-11-23, 19:37:30
RE: Links Manager (was Link Manager 2) - by Rene - 2013-11-30, 00:27:34
RE: Links Manager (was Link Manager 2) - by morvy - 2015-06-05, 19:50:10
RE: Links Manager (was Link Manager 2) - by morvy - 2015-06-10, 08:28:46
RE: Links Manager (was Link Manager 2) - by Tyblitz - 2015-06-10, 09:06:16
RE: Links Manager (was Link Manager 2) - by morvy - 2015-06-10, 20:04:38
RE: Links Manager (was Link Manager 2) - by morvy - 2015-06-16, 03:59:12
RE: Links Manager (was Link Manager 2) - by morvy - 2015-06-19, 01:21:37
RE: Links Manager (was Link Manager 2) - by morvy - 2015-08-11, 20:31:40
RE: Links Manager (was Link Manager 2) - by morvy - 2015-08-12, 11:46:32
RE: Links Manager (was Link Manager 2) - by morvy - 2015-09-18, 10:23:01
Link Manager 2 - by Carlos - 2012-10-29, 07:10:45
Link Manager 2 - by Carlos - 2012-10-29, 07:29:40
Link Manager 2 - by mrdragonraaar - 2012-10-29, 10:05:06
Link Manager 2 - by mrdragonraaar - 2012-10-29, 10:11:11
Link Manager 2 - by mrdragonraaar - 2012-10-29, 11:29:05
Link Manager 2 - by Carlos - 2012-10-30, 01:35:52
RE: Link Manager 2 - by mrdragonraaar - 2012-10-30, 09:34:47
RE: Link Manager 2 - by mrdragonraaar - 2012-11-03, 09:50:35



Users browsing this thread: 6 Guest(s)