Quantcast
Viewing all articles
Browse latest Browse all 2189

phpBB Custom Coding • Re: External connection to a second db

ok got it! tnx!

another one...plzzzzz Image may be NSFW.
Clik here to view.
:lol:
Image may be NSFW.
Clik here to view.
:lol:


i have another problem in main_listener...
i just want to add one info in the array postrow.

so i wrote:

Code:

public static function getSubscribedEvents(){return ['core.user_setup'=> 'load_language_on_setup','core.page_header'=> 'add_page_header_link','core.viewonline_overwrite_location'=> 'viewonline_page','core.viewtopic_cache_user_data'=> 'aggiungi_cache','core.viewtopic_modify_post_row'=> 'assegna_template',];}/* @var \phpbb\language\language */protected $language;/* @var \phpbb\controller\helper */protected $helper;/* @var \phpbb\template\template */protected $template;/** @var string phpEx */protected $php_ext;/** * Constructor * * @param \phpbb\language\language$languageLanguage object * @param \phpbb\controller\helper$helperController helper object * @param \phpbb\template\template$templateTemplate object * @param string                    $php_ext    phpEx */public function __construct(\phpbb\language\language $language, \phpbb\controller\helper $helper, \phpbb\template\template $template, $php_ext){$this->language = $language;$this->helper   = $helper;$this->template = $template;$this->php_ext  = $php_ext;}....etcpublic function aggiungi_cache($event){$user_cache_data = array('donatore'=> $row['user_donatore'],);}public function assegna_template($event){$event['post_row'] = array_merge($event['post_row'], array('DONATORE'=> !empty($user_cache[$poster_id]['author_username']) ? $user_cache[$poster_id]['donatore'] : null,));}
so i keep the user_cache_data from the db in the column user_donatore with the function "aggiungi_cache"

and put into the template with the second "assegna_template"

but it doesn't work.
in html

Code:

{{ postrow.DONATORE }}
does not display anything...

plus...the main page of the testing forum displays the error:
Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class sebo\donatore\event\main_listener does not have a method "display_forums_modify_template_vars" in C:\xampp\htdocs\test\ph...
how can i solve? Image may be NSFW.
Clik here to view.
:?:


PS. whic one do i have to use? "array" or "array_merge"?!?!
i've tried to copy here viewtopic.php?t=2593141 but it does not seems to work

Statistics: Posted by sebo — Sat Feb 17, 2024 2:43 pm



Viewing all articles
Browse latest Browse all 2189

Trending Articles