[solved- but not in core yet] SetUserTag() - how to use in an install

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
JeremyBASS

[solved- but not in core yet] SetUserTag() - how to use in an install

Post by JeremyBASS »

Hello, any one know how to use the

SetUserTag()

I'm working in a method.install.php

I have been tring all types of things but this is where I'm left at..

Code: Select all

$fn = cms_join_path(dirname(__FILE__),'UDT','orig_URLhere_UDT.tpl');
if( file_exists($fn) )
{
  $template = file_get_contents($fn);
  $core = & $gCms->usertagoperations();
  $core->SetUserTag('URLhere', $template);
}
any ideas... I'm sure it's simple

Cheers
jeremyBass
Last edited by JeremyBASS on Sat May 23, 2009 6:52 pm, edited 1 time in total.
JeremyBASS

Re: SetUserTag() - how to use in an install

Post by JeremyBASS »

and this didn't work nor throw an error...

Code: Select all


$fn = cms_join_path(dirname(__FILE__),'templates','orig_URLhere_UDT.tpl');
if( file_exists($fn) )
{
  $template = file_get_contents($fn);
  $usertagops =& $gCms->GetUserTagOperations();
  $usertagops->SetUserTag('URLhere', $template);
}

viebig

Re: SetUserTag() - how to use in an install

Post by viebig »

Hey jeremy...

did you try turning debug on to see if the query is really performed?

something like:

Code: Select all

INSERT INTO userplugins (userplugin_name, code, create_date, modified_date)
Regards.

G
JeremyBASS

Re: SetUserTag() - how to use in an install

Post by JeremyBASS »

Oh I should had posted that last night.. I was getting tired of working and got a little lazy... 17 stright is a long day...


this is the debug...


Debug: (0.257972) - (10379920)


(mysql): SELECT userplugin_id, code FROM cms_154_userplugins WHERE userplugin_name = 'URLhere'
Error (0):

Debug: (0.258634) - (10381936)


(mysql): INSERT INTO userplugins (userplugin_name, code, create_date, modified_date) VALUES ('URLhere','$urlBASE = \"http://\".$_SERVER[\'HTTP_HOST\'].$_SERVER[\'SCRIPT_NAME\'];\r\nif (!empty($_SERVER[\"QUERY_STRING\"]))\r\n$urlBASE .= \"?\".$_SERVER[\'QUERY_STRING\'];\r\nif (isset($config[\'assume_mod_rewrite\']) && ($config[\'assume_mod_rewrite\']==true)) {\r\n$urls = str_replace(\"index.php?page=\", \"\", $urlBASE);\r\n}else{\r\n$urls = $urlBASE;\r\n}\r\n\r\necho $urls;','2009-05-23 11:36:08','2009-05-23 11:36:08')
Error (1146): Table 'cms_154.userplugins' doesn't exist
I'm hitting it again now hopfully now that I sleeped I can get it... :) but any help would be great...

Thanks

Jeremy
JeremyBASS

Re: SetUserTag() - how to use in an install

Post by JeremyBASS »

ok.. easy solve.. man I was sleepy last night... this was way simple... :)

thanks viebig

cheers
Jeremy
Post Reply

Return to “Developers Discussion”