*

Recent

Author Topic: Announcement and Facebook Login  (Read 13358 times)

Azedbutt

  • Newbie
  • *
  • Posts: 38
  • Force: +0/-0
    • Loose Game
Announcement and Facebook Login
« on: October 25, 2011, 06:35:40 AM »
Hey guys

I was wondering if someone could create mod for Announcements and Facebook login integration with the FAS.

Announcements
A box, just above the games on the homepage saying whatever text the admin wants. Check my website www.loosegame.com - I was wondering if its possible to create a table above the 'Shooting and Puzzle game table' which will allow the admin to edit text and give announcements.

Facebook Login Integration - http://developers.facebook.com/docs/authentication/

I tried to follow the instructions above but failed miserable after spending several hours. Does anyone has any idea how to integrate Facebook Login with the FAS? this would be very beneficiary to me as the majority of my traffic come from facebook users.

You're help and time is greatly appreciated  :)

Azed

Azedbutt

  • Newbie
  • *
  • Posts: 38
  • Force: +0/-0
    • Loose Game
Re: Announcement and Facebook Login
« Reply #1 on: November 05, 2011, 06:44:34 AM »
Can someone just do the Announcement bit if the Facebook Login is too complex?

If someone knows how to do the Facebook Login and wants to do it for money, could you pm me please and we can try and work something out?

Azed

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Announcement and Facebook Login
« Reply #2 on: November 05, 2011, 01:23:52 PM »
I'll try and do it for free. But it will be on my own time.. try my best though. I think I had it running once actually, dunno where I stuck the code.
I could redo it though, minds well throw it into the next release also.
At most it will take three days I would say, don't promise though.. just a estimation.

The announcement feature is a quick easy addon I can do in half an hour or so since I am pretty busy fixing up my site right now.

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Announcement and Facebook Login
« Reply #3 on: November 05, 2011, 01:59:44 PM »
Code: [Select]
ALTER TABLE  `dd_settings` ADD  `announcements` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL AFTER  `enabledcode_on`

includes/core.php
add this:
Code: [Select]
$announcements = $set['announcements'];
after this:
Code: [Select]
foreach($set1 as $set){

templates/YOUR_TEMPLATE/template.php
add this:
Code: [Select]
<?php
if (!empty(
$announcements)) {
echo ' <table width="700" align="center">

<tr>
<td class="header">Announcements</td>
</tr>

<tr>
<td class="content">'
.$announcements.'</td>
</tr></table><br>'

};
?>

after this:
Code: [Select]
      <?php if (!$headerspace == "") { echo '<div align="center">'.$headerspace.'</div><br>'; }; ?>

/pages/admin/settings.php
add this:
Code: [Select]
$sannouncements = clean($_POST['announcements']);
after this:
Code: [Select]
if(isset($_POST['submit'])){

/pages/admin/settings.php
add this:
Code: [Select]
announcements=\''.$announcements.'\',
after this:
Code: [Select]
domain=\''.$sdomain.'\',

add this:
Code: [Select]
</tr>
<td class=\'content5\'>Announcements:
</td>
<td class=\'content5\'><textarea name=\'announcements\' rows=\'12\' cols=\'50\' >'.$announcements.'</textarea></td>
</tr>
after this:
Code: [Select]
</tr>
<td class=\'content5\'>Default Meta Description:
</td>
<td class=\'content5\'><input type=\'text\' name=\'metadescr\' size=\'40\' value=\''.$set['metadescr'].'\'></td>
</tr>


So now you can change the announcements in the settings page under admin. If you leave the field empty the box then the header and content box will not appear to anyone.

I didn't check if this worked so lemme know if you run into any problems

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Announcement and Facebook Login
« Reply #4 on: November 05, 2011, 06:59:40 PM »
I think it needs a couple of small changes. ;)

Code: [Select]
announcements=\''.$announcements.'\',

To:

announcements=\''.$sannouncements.'\',

________________________________________

<td class=\'content5\'><textarea name=\'announcements\' rows=\'12\' cols=\'50\' >'.$announcements.'</textarea></td>

To:

<td class=\'content5\'><textarea name=\'announcements\' rows=\'5\' cols=\'30\' >'.$set['announcements'].'</textarea></td>

_____________________________________________


And it's

<tr>
<td>

</td>
</tr>
:(

am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
Re: Announcement and Facebook Login
« Reply #5 on: November 05, 2011, 07:22:15 PM »
Facebook Login Integration
Been working on this from day one, i cant get it, not even the simple like button.

Hopefully someone can
« Last Edit: November 06, 2011, 12:57:26 AM by am-fs »

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Announcement and Facebook Login
« Reply #6 on: November 05, 2011, 11:17:52 PM »
I think it needs a couple of small changes. ;)

.........
announcements=\''.$sannouncements.'\',
......
And it's
<tr>
<td>

</td>
</tr>
Everything for fixes except for the pieces above that I quoted are fine.
I didn't even notice that they were all closing tags xD
and you don't have to use the $set array

Azedbutt

  • Newbie
  • *
  • Posts: 38
  • Force: +0/-0
    • Loose Game
Re: Announcement and Facebook Login
« Reply #7 on: November 06, 2011, 05:42:24 AM »
In my Template I don't have the code you put above

Quote
      <?php if (!$headerspace == "") { echo '<div align="center">'.$headerspace.'</div><br>'; }; ?>

My website has:

Quote
<?php

      if (!$headerspace == "") { echo '<br><div align="center">'.$headerspace.'</div><br>'; };

So when I insert the ?> at the end of code I have in my website currently, all my buttons such as 'Home', 'Top Games' don't work at all. And I played around a little, I can't seem to get around this. Any help?

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Announcement and Facebook Login
« Reply #8 on: November 06, 2011, 06:25:26 AM »

One would like to know where the closing tag ?> for this is located? And you should be able to add the Announcements after that?

<?php

      if (!$headerspace == "") { echo '<br><div align="center">'.$headerspace.'</div><br>'; };

Or put your "Announcement string before the <?php here.

And you may like to change the <br>'s to <br /> while you are there. ;)
« Last Edit: November 06, 2011, 06:27:55 AM by mort »

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Announcement and Facebook Login
« Reply #9 on: November 08, 2011, 09:32:59 PM »
and you don't have to use the $set array

If you don't and you submit it - Then it's gone and can't be edited. In other words the input returns blank after submit?

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Announcement and Facebook Login
« Reply #10 on: November 09, 2011, 12:49:28 AM »
$announcements = $set['announcements'];
So you should be able to use either one.

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Announcement and Facebook Login
« Reply #11 on: November 09, 2011, 05:40:09 AM »
I can only suggest that you try it both ways to see the results. ;)