|
Title: Twitter Integration Modification Post by: Mark on December 18, 2009, 06:35:50 PM Please be kind, this is the first modification that I have made. :)
PART A - Twitter Announcements 1. Copy and paste the code below into a file and name it tannounce.php 2. Change where it says "whatsonthetube" to your Twitter username Code: [Select] <?php3. Open mainmenu.php and find: Code: [Select] <a href='announcement.php'>Announcements</a><br />and add below Code: [Select] <a href='tannounce.php'>Twitter</a><br />PART B - Twitter Profile Integration 1. Create tusername in the users table, and set the default to your Twitter account username 2. Copy and paste the following into your viewuser.php page Code: [Select] <script src='http://widgets.twimg.com/j/2/widget.js'></script>3. Open preferences.php and find: Code: [Select] case 'picchange':Then add below: Code: [Select] case 'twitterusername':You will then need to find: Code: [Select] <a href='preferences.php?action=picchange'>Display Pic Change</a><br />And add below: Code: [Select] <a href='preferences.php?action=twitterusername'>Twitter Username</a><br />Then add the following function at the bottom of the page: Code: [Select] function twitter_username()What you should have achieved, if I posted everything correctly: 1. You should have an announcements page showing your Tweet updates 2. There should be a Twitter module on the viewuser.php page, most likely displaying your tweets by default 3. Users should be able to change the Twitter username in Preferences, thus changing tweets displayed on their profile What you can do to help: I am a novice at programming, and it would be good if people could help me to improve this modification. A change that I would like to make is the option for users to hide the module on their profile if they do not have Twitter or do not wish to use it. Title: Re: Twitter Integration Modification Post by: Mark on December 18, 2009, 06:41:55 PM (http://i198.photobucket.com/albums/aa11/proudmdf/twittermod.jpg)
Title: Re: Twitter Integration Modification Post by: catles on December 18, 2009, 08:59:38 PM to hide this on profile
SQL Code: [Select] ALTER TABLE `users` ADD `showtwitt` INT( 1 ) NOT NULL DEFAULT '0'the profile code Code: [Select] if ($ir['showtwitt']==1)and the very end thing you added Code: [Select] function twitter_username()now you could also do the way the pic one works to witch i can show you if you like it may end up working better Title: Re: Twitter Integration Modification Post by: Mark on December 18, 2009, 10:24:52 PM Thanks for your input. If you believe that it has a benefit, then by all means post it. :)
Title: Re: Twitter Integration Modification Post by: catles on December 18, 2009, 10:30:25 PM well i looked over it and realized you can do more with this one then the other one including not limited to the user can make it so only friends can see it tho it would be harder to code
Title: Re: Twitter Integration Modification Post by: Mark on December 18, 2009, 10:48:11 PM well i looked over it and realized you can do more with this one then the other one including not limited to the user can make it so only friends can see it tho it would be harder to code That would not be a bad idea, it could put the friends list feature to use. This way users would be able to control who sees their tweets in the game, and only allow people on their friends list to see them. (I am not sure if the friends list is in the lite version, though I am sure that it can be coded in.) Title: Re: Twitter Integration Modification Post by: Danny696 on December 19, 2009, 06:36:58 AM I like the mod, but what about people who dont use twitter
Title: Re: Twitter Integration Modification Post by: Cronus on December 19, 2009, 07:06:09 AM Since this is only a lite version, i don't believe it will need twitter integration.
However it is a good thought, perhaps on a later version Title: Re: Twitter Integration Modification Post by: dominion on December 19, 2009, 07:18:06 AM hey mark is it ok if i play around with this i would like to make it work with the game i have been developing
and cronus i think you should having one or two things that even v2 does not have will get people to stop trying to find v2 for free when they see this can be worked on it would also get them to buy more of your mods ;) Title: Re: Twitter Integration Modification Post by: Mark on December 19, 2009, 09:27:00 AM hey mark is it ok if i play around with this i would like to make it work with the game i have been developing Sure, that is not a problem. :) Danny696, I am not suggesting that it comes included in the script, I am just suggesting that documentation be included with instructions on how to install the modification, in case someone likes it and wants to use it. Cronus, Dominion is right about including features that V2 doesn't even have, and it does give you an opportunity to make some more money, and reduce the amount of V2 pirate websites. If you decide otherwise, then could you please move this thread to the free modifications section, rather than delete it. :) Title: Re: Twitter Integration Modification Post by: Zeddicus on December 19, 2009, 11:17:16 AM Mark, I do suggest using "mysql_real_escape_string" on your "$_POST['twitterchange']".
And also securing output to stop XSS ect ect Other than that it looks pretty good :) Title: Re: Twitter Integration Modification Post by: Djkanna on December 19, 2009, 12:19:06 PM I use this on my blog
Code: [Select] <?phpUsage: Code: [Select] <?php Twitter("Djkanna"); // Obviously change that for example $r['twitter_account'] ?> Just another way you could do it.. And for example you could use Twitter($r['twitter_account']); and have like a preferences part where a user can change it just a thought ;) EDIT: Will only work if your server allows Simple Xml :) |