Jump to content

Twitter hook to set Twitter account based on client


mscholten

Recommended Posts

Hello,

 

I'm working on making it possible to show a Twitter feed based on the client. That way we can show different feeds for resellers and end-users. When someone isn't logged in I would probably show the end-user Twitter account. Changing the Twitter account for the URLs pointing to Twitter is easy. However with an AJAX (?) call it doesn't work. From WHMCS support I did hear I should be able to create some output on it when using the ClientAreaPage hookpoint. However this doesn't seem to work as the code below doesn't return any content (and that is what I would expect).

 

<?php
function whmcs_hook_test($vars){
var_dump($vars);
}

add_hook('ClientAreaPage',10,'whmcs_hook_test');

 

Any pointers as where to look? Or should I just create a new PHP file for it that gets the required information from Twitter and call that file using the Javascript?

Link to comment
Share on other sites

are you talking about the twitter feed on the client area homepage ? where, what & how you want to do something are important when determining which hook (if any) is used...

if so, I think the twitter username is pulled directly from the database and possibly can't be overwritten with a hook.

 

if you're trying to do what I think you're trying to do, i'd probably leave the homepage as is and let it use the twittername assigned in the settings and then logged in clients can see their own clientarea homepage and tweak that to show a different twitterfeed - either by a 3rd-party method or using a homepagepanel hook.

 

or don't use the built-in twitter feed option at all, but use a hook/3rd party to show a different feed depending on whether the client is logged in or not, and/or the class of the client.... depending on the twitter solution, you might not even need a hook and could be able to do it purely by editing the template with Smarty.

Link to comment
Share on other sites

An interesting idea, is it, would it be possible to make the Twitter Feed a Block in the Client Area when logged in?

most things are possible! :idea:

 

Or does it matter if it's a block or not?

it doesn't matter... but where you want it determines which hook to use...

 

e.g if you wanted the twitter feed in a homepage panel...

 

UT1Qac6.png

 

the above uses RSS feeds... one from the BBC News and one, via a 3rd party, for twitter.... though you could do it directly via Twitter instead if you had to...

 

http://forum.whmcs.com/showthread.php?106067-Trying-to-display-RSS-feeds-in-Client-Area-without-success&p=436374#post436374

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated