Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 202
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 3
Guests: 106
Total: 109

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - 420connect

Pages: [1] 2 3 4
1
Support / Re: "Special Days"
« on: April 07, 2015, 10:06:00 am »
I may have came up with a solution if another idea is possible..

Can you put together a MYSQL command thing (lol) that will 'grab' data from 2 different tables, rather than 1?


appreciated if you can make a template code where I can fill in the blanks sort of thing..

Thank you

2
Support / Re: "Special Days"
« on: April 07, 2015, 09:34:45 am »
$t = time();
echo date("n",$t) . " "  . date("j",$t) ;

displays as 4 7 (month and day) like it should when tested in a php file but I'm wanting to only award a user if they have logged in on the specified dates..

Using the code below gives the badge to people who haven't been logged in for a long time (the wrong people get the badge) although I have said to only award those who have logged in today. (as a test)

Code: [Select]
$t = time();

if (date("n",$t) == 4 && date("j",$t) == 6)
{
 // Badge code here

{
$badgeAction = 'test2';
if (!in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}


}
//end badge code
}

I'm sorry for being a nuisance, like I've said I don't really have a clue about php but thought echo basically meant display? ...so I don't really see how using echo in my example would do the job of the 'IF' function...

3
Support / Re: "Special Days"
« on: April 07, 2015, 07:21:43 am »
Managed to un-do my badging of the wrong people! (yey!)


I also noticed I had accidentally left in another line in my previous code..
(and just tested replacing "if" with "echo" but I get errors with that:

Code: [Select]
$t = time();

echo (date("n",$t) == 4 && date("j",$t) == 6)
{
 // Badge code here

{
$badgeAction = 'test2';
if (!in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}


}
//end badge code
}



Much appreciated if you can fix the above to a working code

& I think I've managed to sort out my numbers for the never sleep badge :)


~ Forever grateful :)

4
Support / Re: "Special Days"
« on: April 06, 2015, 04:55:03 pm »
Eeek...

I've just accidently badged out 150 pages worth of badges I didn't really mean to..

I was testing 2 custom codes, as I noticed I was missing a part or two..

I don't think either of them functioned correctly either but I really don't know what I'm doing with php :P.. (wrong people awarded)

Appreciated if you can review the below, and any quicker ways to undo my badging mistake?

Ty


Code: [Select]
// never sleep

if (!in_array('neversleep',$currentBadges))
{
$starttime = 1140;
$result = $smcFunc['db_query']('', "
SELECT COUNT(*) AS total FROM {db_prefix}members
WHERE ID_MEMBER = $memberID AND TOTAL_TIME_LOGGED_IN >= $starttime
"); 

$badgeAction = 'neversleep';
if (!in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}


}
//end of new badge

Code: [Select]




$t = time();

if (date("n",$t) == 4 && date("j",$t) == 6)
{
 // Badge code here

if (!in_array('anniversary1',$currentBadges))
{
$badgeAction = 'test2';
if (!in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}


}
//end badge code
}

5
Support / Re: "Special Days"
« on: April 06, 2015, 04:23:25 pm »
I would get rid of 0 in front of the number

:( still no luck

6
Support / Re: "Special Days"
« on: April 06, 2015, 12:24:27 pm »
Quick

Code: [Select]
$t = time();

if (date("n",$t) == 12 && date("j",$t) == 25)
{
 // Badge code here
}





I tried testing it with today's date and the anniversary badge for a test but no luck although I received no errors..


Does this look right?

Code: [Select]
$t = time();

if (date("n",$t) == 04 && date("j",$t) == 06)
{
 // Badge code here
if (!in_array('anniversary1',$currentBadges))
{

{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}


}
//end badge code
}





Also, could I add 'rebadge members' to my scheduled tasks? or the same idea, as code in a file?
- I quite often find I need to rebadge to actually award a lot of mine and with rebadging, I don't seem to get the PM notification like if you had normally been awarded it..

7
Support / "Special Days"
« on: April 06, 2015, 11:47:41 am »
I'm trying to come up with some new ideas for badges to make and wondered, Could you throw together a quick badge action so that if a user logs in on (chosen date) they are awarded a badge.

e.g - Log in on 25th of December = unlock christmas badge.  :D


Many thanks as always!

8
Latest Mods / Re: [Mod]E-Arcade - Reborn
« on: April 06, 2015, 11:43:34 am »

& Also, should this page have very little styling?
/index.php?action=arcade;sa=pro_stats;ta=[ID]

(I'm not sure if this is a bug or intentional but would like to add a pop-up background / table like the smileys pop-up is displayed if possible?)

Many thanks

* Bumping this part..

Example of how mine looks:


9
Support / Re: OS awards twice
« on: April 05, 2015, 05:44:06 am »
Just thought I would add that I too have experienced this with my site
 (2 of the same badges being awarded at a time)

It seemed to stop happening on it's own and I just removed the double badges where I found them..

10
News / Re: Badge Awards 2.0 Released
« on: April 04, 2015, 03:38:04 am »
Put that code after

Code: [Select]
ArcadeUpdatePositions($id_game,$id_score,$newPosition);

In Sources/ArcadePlay.php


Thank you as always!  ;D

11
News / Re: Badge Awards 2.0 Released
« on: April 02, 2015, 02:10:07 am »
Hey,

Just tried to install this again and got a fail on this:

Code: (find) [Select]
cache_put_data('arcade-stats', null, 120);
Code: (add after) [Select]
// Begin Badge Awards Text Strings

global $sourcedir, $modSettings;
if (!empty($modSettings['badgeawards_enable']))
{

global $sourcedir, $user_info;
require_once($sourcedir . '/badgeawards2.php');
if ($member['id'] != 0)
Badges_CheckMember($member['id']);
}


// END Badge Awards Text Strings

in Subs-Arcade.php


- Tried manually searching my Subs-Arcade.php for anything similar but the best I could find was:

Code: [Select]
cache_put_data('arcSettings', $arcSettings, 90);or
Code: [Select]
cache_put_data('arcSettings', null, 90);

Could you assist in having a smooth install?

Many thanks as always!

(Subs-Arcade.php attached in case?)

12
Latest Mods / Re: [Mod]E-Arcade - Reborn
« on: March 19, 2015, 12:29:38 pm »
Trying to add a block of random games with an old code I've found to SP

It works as expected but when I have the block enabled, the blocks below it have database error messages showing /blocks are missing..

Would you mind having a look over this code to see if it's missing something obvious to end the script of something?

Many thanks!

Code: [Select]
global $db_prefix, $scripturl, $modSettings, $boardurl, $smcFunc, $context;
$check_game = !empty($_REQUEST['game']) ? (int) $_REQUEST['game'] : 0;

if ($check_game == false)
{
   $arcade = '<table><tr>';
   $count1 = 0;
   $icons_per_row = 4;
$id_game = false;
$user_info = false;
if (($context['user']['is_guest']) == false)
{
  $request = $smcFunc['db_query']('', '
      SELECT game.id_game, game.game_name, game.game_directory, game.thumbnail
      FROM {db_prefix}arcade_games AS game
     ORDER BY RAND()
   
      LIMIT 28',
array(
'game' => $id_game,
'string_empty' => '',
'member' => $user_info,
)
   );

   while ($row = $smcFunc['db_fetch_assoc']($request))
   {

      if ($count1 > ($icons_per_row - 1)){$count1 = 0; $arcade .= '</tr><tr>';}
      $count1++;
      $arcade .= '<td align="center"><a href="' . $scripturl . '?action=arcade;sa=play;game=' . $row['id_game'] . '"><img style="width:42px; height:42px;" src="' . $boardurl . '/Games/';
      if(isset($row['game_directory']) && $row['game_directory'] != '') {$arcade .= $row['game_directory'] . '/';}
      $arcade .= $row['thumbnail'] . '" alt="'.$row['game_name'].'" title="'.$row['game_name'].'" /></a></td>';
   
   }
$smcFunc['db_free_result']($request);
   
   $arcade .= '</tr></table>';
}
else
{
  $request = $smcFunc['db_query']('', '
      SELECT game.id_game, game.game_name, game.game_directory, game.thumbnail
      FROM {db_prefix}arcade_games AS game
     ORDER BY RAND()
   
      LIMIT 60',
array(
'game' => $id_game,
'string_empty' => '',
'member' => $user_info,
)
   );

   while ($row = $smcFunc['db_fetch_assoc']($request))
   {

      if ($count1 > ($icons_per_row - 1)){$count1 = 0; $arcade .= '</tr><tr>';}
      $count1++;
      $arcade .= '<td align="center"><a href="' . $scripturl . '?action=arcade;sa=play;game=' . $row['id_game'] . '"><img style="width:42px; height:42px;" src="' . $boardurl . '/Games/';
      if(isset($row['game_directory']) && $row['game_directory'] != '') {$arcade .= $row['game_directory'] . '/';}
      $arcade .= $row['thumbnail'] . '" alt="'.$row['game_name'].'" title="'.$row['game_name'].'" /></a></td>';
   
   }

   
   $arcade .= '</tr></table>';
}
   echo $arcade;
$smcFunc['db_free_result']($request);
}

13
Support / Re: Expand Seller Information
« on: March 18, 2015, 04:27:51 pm »
Aha, got it working now! :)

I was pairing it with the wrong chunks of code before!

Many thanks as always!  :-*

14
Support / Re: Expand Seller Information
« on: March 18, 2015, 04:13:14 pm »
can you also confirm if I should be replacing "$memberidhere" with something else or not as I've tried a few different versions but still no luck / same results.

15
Support / Re: Expand Seller Information
« on: March 18, 2015, 04:05:15 pm »
no visible change in results :(

Pages: [1] 2 3 4

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal