Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Session Integration: Code Help
I'm using a chat-bar called Skysa, and I needed help integrating it with Vanilla. The code (in a js file) is embedded in my theme. Here it is:
var _SKYAUTH = {
loginUrl:'http://mysite.com/entry',
memberNick:'{$GDN_User->Name}',
memberId:'{$GDN_User->UserID}',
profileUrl:'//need help here',
photoUrl:'{$GDN_User->Photo}',
};
It's seems like this should work fine, but it signs the user in with the name "{$GDN_User->Name}" and everything else has the same problem. Could someone PLEASE help me out here? It would be greatly appreciated.
Thanks in advance,
Matt.
EDIT: Just to be clear, "GDN_" is my table prefix in mySQL
var _SKYAUTH = {
loginUrl:'http://mysite.com/entry',
memberNick:'{$GDN_User->Name}',
memberId:'{$GDN_User->UserID}',
profileUrl:'//need help here',
photoUrl:'{$GDN_User->Photo}',
};
It's seems like this should work fine, but it signs the user in with the name "{$GDN_User->Name}" and everything else has the same problem. Could someone PLEASE help me out here? It would be greatly appreciated.
Thanks in advance,
Matt.
EDIT: Just to be clear, "GDN_" is my table prefix in mySQL
1
Comments
I've tried adding parentheses, and making other odd changes but I can't seem to figure this out...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-ca"> <head> {asset name="Head"} </head> <body id="{$BodyID}" class="{$BodyClass}"> <div class="Banner"> <div class="BannerWrapper"> <h1><a href="{link path="/"}"><span>{logo}</span></a></h1> <div class="Buttons"> <div class="UserOptions"> <div> {if $User.SignedIn} <a href="{link path="profile"}"> {$User.Name} {if $User.CountNotifications} <span>{$User.CountNotifications}</span> {/if} </a> <a href="{link path="messages/inbox"}">Inbox {if $User.CountUnreadConversations} <span>{$User.CountUnreadConversations}</span> {/if} </a> {if CheckPermission('Garden.Settings.Manage')} <a href="{link path="dashboard/settings"}">Dashboard</a> {/if} {/if} {link path="signinout"} {if !$User.SignedIn} <a href="{link path="register"}">Apply for Membership</a> {/if} </div> </div> <ul> <li class="Donate"><a href="mysite.com/hw/community/plugin/page/donate">Donate</a></li> <li class="Home"><a href="http://mysite.com/hw/community/profile/invitations">Invite Someone</a></li> <li class="Home"><a href="mysite.com">Home</a></li> </ul> </div> </div> </div> <div id="Frame"> <div id="Body"> <div id="Content">{asset name="Content"}</div> <div id="Panel">{asset name="Panel"}</div> </div> <div id="Foot"> <div> Copyright © <a href="mysite.com/hw/community/profile/1/matt531320"><span>matt531320</span></a>, <a href="http://bit.ly/hwhelper"><span>Homework Helper</span></a>, and <a href="http://vanillaforums.org"><span>Vanilla Forums</span></a>. </div> </div> <script type="text/javascript" src="mysite.com/hw/community/chat/login.js" async="true"></script> <script type="text/javascript" src="http://static2.skysa.com?i=MYCODE" async="true"></script> </body> </html>
That would be "default.master.tpl"
A link to the full file here:
http://bit.ly/aMLHBW
<script type="text/javascript" src="mysite.com/hw/community/chat/login.js" async="true"></script>
Try putting the actual source of login.js (it at least the part you pasted) inside a script block in the head of that template file and see if that does anything.
Edit: gtg for the nite.
I don't really know the causes of the Bonk! error, the only time it happened to me (when i deleted cache/*) I had to rename conf/config.php, run setup again and copy the renamed file over the new one to get the forum running again. that may not be necessary in this case. it may just be a broken template.
Could we try doing this from a plugin? One that would just insert the bar code and the integration code on every page? How would I go about doing that? (I have no knowledge of writing plugins - but I could learn
this could probably be done with a plugin, but if i can't see the entire code i can't tell if there's anything that needs to be in a theme instead.
<?php if (!defined('APPLICATION')) die(); $PluginInfo['Skysa'] = array ( 'Name' => 'Skysa', 'Description' => 'Adds Skysa with Intergration Code', 'Version' => '1.0', 'Author' => 'matt531320', 'AuthorEmail' => '', 'AuthorUrl' => '', ); class skysaPlugin extends Gdn_Plugin { public function Base_Render_Before(&$Sender) { $Sender->Head->AddString ( "<script type='text/javascript'> var _SKYAUTH = { loginUrl:'http://mysite.com/entry', memberNick:'$GDN_User->Name', memberId:'$GDN_User->UserID', profileUrl:'', photoUrl:'$GDN_User->Photo', }; </script> <script type='text/javascript' src='http://static2.skysa.com?i=6CCE1C4F-6F19-46E8-BABC-9F98386FC1D6' async='true'></script>" ); } public function Setup() { } }
The bar shows up fine, but it keeps sending me to the login page of my site when I try to use it (basically meaning that it thinks the user isn't logged in). Could you help me with this?