<script type="text/javascript" charset="utf-8"><!-- tfb.account = "{$accountlist}"; tfb.label = "follow-us"; tfb.color = "#35ccff"; tfb.side = "l"; tfb.top = 136; tfb.showbadge(); --></script> Code (markup): im echoing $accountlist so i can insert my said account name on that particular script.. how to do it? thanks
Hi, if the variable $accountlist is formatted as JSON (e.g. $accountlist = "member:'value',member1:'value'", you can simply write: tfb.account = "{<?php echo $accountlist ?>}"; Just keep in mind that the page needs to be .php...
variable $accountlist is on php.. like: $accountlist = mybb=>settings <-- just an example of the code how to write on javascript so i can change any echo for it.. thanks
Hi, I'm sorry, but I'm not sure what do you mean... This should be : $accountlist = $mybb->settings; But how do you want to change echo on javascript??? You could use function json_encode() to get JSON string from the 'settings' array you have, and then access it in javascript e.g. via tfb.account.name, but I'm not really sure if it is what you want... Can you explain more clearly your intentions?
i think my problem was solve when i make a variable to determine it on php.. before i have set the javascript on my template.. it works if i make a function via php.. anyway, thanks a lot! ill post again here whenever i have a problem.. thanks $accountlist = $mybb->settings['xxx_account']; <script type=\"text/javascript\" charset=\"utf-8\"><!-- tfb.account = \"{$accountlist}\"; tfb.label = \"{$xxx}\"; tfb.color = \"#35ccff\"; tfb.side = \"{$xxx}\"; tfb.top = {$xxx}; tfb.showbadge(); --></script>"; Code (markup):