Jump to content

outputting code into template


szalik.dev
 Share

Go to solution Solved by szalik.dev,

Recommended Posts

so, bassicaly, i created a plugin which should output widget on index with number of members online on discord, here is my code for it:

public function render()
	{
		function settings($name) {

			$key = \IPS\Settings::i()->$name;

			return $key;
		}

		$mc = 0;


		$this->output( $mc );

		return "";
	}

i've added in init() this:

$this->template( array( \IPS\Theme::i()->getTemplate( 'plugins', 'core', 'global'), $this->key));
		
parent::init();

 

and when i visit my website, i get this error:

ParseError: syntax error, unexpected '$return' (T_VARIABLE) (0)
#0 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Theme/Theme.php(4291): IPS\_Theme::runProcessFunction('\tfunction theme...', 'theme_core_glob...')
#1 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Theme/Dev/Template.php(165): IPS\_Theme::makeProcessFunction('<!-- fontAwesom...', 'theme_core_glob...', '$membercount', true)
#2 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Widget/Widget.php(234): IPS\Theme\Dev\_Template->__call('js34moodmain', Array)
#3 /usr/home/devjakso/domains/dev.jakso.pl/public_html/plugins/js34mood/widgets/js34moodmain.php(115): IPS\_Widget->output(112)
#4 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Widget/Widget.php(797): IPS\plugins\js34mood\widgets\_js34moodmain->render()
#5 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Theme/Theme.php(4319) : eval()'d code(75): IPS\_Widget->__toString()
#6 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Theme/Dev/Template.php(171): IPS\Theme\theme_core_front_global_widgetContainer('sidebar', 'vertical')
#7 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Theme/Theme.php(4319) : eval()'d code(105): IPS\Theme\Dev\_Template->__call('widgetContainer', Array)
#8 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Theme/Dev/Template.php(171): IPS\Theme\theme_core_front_global_sidebar('right')
#9 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Theme/Theme.php(4319) : eval()'d code(325): IPS\Theme\Dev\_Template->__call('sidebar', Array)
#10 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Theme/Dev/Template.php(171): IPS\Theme\theme_core_front_global_globalTemplate('a8752820b5474a3...', '\n<div class='ip...', Array)
#11 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Dispatcher/Dispatcher.php(166): IPS\Theme\Dev\_Template->__call('globalTemplate', Array)
#12 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Dispatcher/Standard.php(118): IPS\_Dispatcher->finish()
#13 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Dispatcher/Front.php(574): IPS\Dispatcher\_Standard->finish()
#14 /usr/home/devjakso/domains/dev.jakso.pl/public_html/system/Dispatcher/Dispatcher.php(148): IPS\Dispatcher\_Front->finish()
#15 /usr/home/devjakso/domains/dev.jakso.pl/public_html/index.php(13): IPS\_Dispatcher->run()
#16 {main}

 

there is no $return in my wiget file, i don't know where to look to fix this, any help?

Edited by ~Jakso.`
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...