*

Recent

Author Topic: [Add On] Featured Games  (Read 157634 times)

am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
[Add On] Featured Games
« on: March 19, 2015, 11:05:26 PM »
This Add On will add Featured Games to your sidebar. Show your favorite or sponsored games!



Download zip and replace 2 files in pages/admin

log on to your cpanel, in phpmyadmin and run query
Code: [Select]
ALTER TABLE `fas_games` ADD `featured` tinyint(1) NOT NULL default '0' AFTER `belowgames`

Monster template edit template.php
Add:
Code: [Select]
include("templates/$template/blocks/featured.php");

Tiles Template edit includes/blocks.php
Add:
Code: [Select]
include("templates/$template/blocks/featured.php");

Copy and Paste featured code in a new file named ( featured.php ) for your template.
Monster:
Code: [Select]
<?php
echo'<div class="header">
Featured Games
</div>
<div class="content">'
;
$sqltitle='featuredgames' ;
$featured2 "SELECT * FROM fas_games WHERE active='1' AND featured='1' ORDER BY RAND () LIMIT 5";
$featured1 sqlcache($sqltitle$cachelife$featured2);
if(isset($featured1)){
       foreach($featured1 as $row1 ){
                
$gamename preg_replace('#\W#''-'$row1['name']);
if($row1['type'] == 1){
$img "<img src='".$domain."/".$thumbsfolder."/".$row1["thumb"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}else{
$img "<img src='".$row1["thumburl"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}

echo '<ul class=\'catmenu\'>
<li>'
;
                    if (
$seo_on == 1){
echo "<a href='".$domain."/play/".$row1["ID"]."-".$gamename.".html'>".$img.titlelimit($row1["name"])."</a>";
}else{
echo "<a href='".$domain."/index.php?action=play&amp;ID=" .$row1["ID"]. "'>".$img.titlelimit($row1["name"])."</a>";
}
echo '</li>
</ul>'
;
}
       }else{
echo'<div align="center">No games have been selected!</div>';
}
echo'</div>';
?>


Tiles:
Code: [Select]
<?php
echo'<div class="side_nav">Featured Games</div>
     <div id="side_holder">'
;
$sqltitle='featuredgames' ;
$featured2 "SELECT * FROM fas_games WHERE active='1' AND featured='1' ORDER BY RAND () LIMIT 5";
$featured1 sqlcache($sqltitle$cachelife$featured2);
if(isset($featured1)){
       foreach($featured1 as $row1 ){
                
$gamename preg_replace('#\W#''-'$row1['name']);
if($row1['type'] == 1){
$img "<img src='".$domain."/".$thumbsfolder."/".$row1["thumb"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}else{
$img "<img src='".$row1["thumburl"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}

echo '<ul class=\'catmenu\'>
<li>'
;
                    if (
$seo_on == 1){
echo "<a href='".$domain."/play/".$row1["ID"]."-".$gamename.".html'>".$img.titlelimit($row1["name"])."</a>";
}else{
echo "<a href='".$domain."/index.php?action=play&amp;ID=" .$row1["ID"]. "'>".$img.titlelimit($row1["name"])."</a>";
}
echo '</li>
</ul>'
;
}
       }else{
echo'<div align="center">No games have been selected!</div>';
}
echo
'</div>';
?>


Now login your arcade => admin => Manage Games => Selected games for your featured games.

am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
Re: [Add On] Featured Games
« Reply #1 on: April 02, 2015, 09:31:18 PM »
Add Featured Games to Home Page on Monster Template



templates/monster/base_home.php
Find:
Code: [Select]
function writebody() {
global $db, $domain, $sitename, $domain, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid;

Add Below:
Code: [Select]
       echo '<div class="header2" align="left">Featured Games</div>
       <div class="content2">';
$sqltitle='featuredhome' ;
$featured2 = "SELECT * FROM fas_games WHERE active='1' AND featured='1' ORDER BY RAND () LIMIT 9";
$featured1 = sqlcache($sqltitle, $cachelife, $featured2);
if(isset($featured1)){
      foreach($featured1 as $row1 ){
                $gamename = preg_replace('#\W#', '-', $row1['name']);
      if($seo_on == 1){
      $playlink = '/play/'.$row1['ID'].'-'.$gamename.'.html';
      }else{
      $playlink = '/index.php?action=play&amp;ID='.$row1['ID'].'';
      }

if($row1['type'] == 1){
echo '<div id="featured_holder"><a href=\''.$playlink.'\'><img src=\'/'.$thumbsfolder.'/'.$row1['thumb'].'\' width=\'90\' height=\'90\' alt= \''.$row1['name'].'\' title= \''.$row1['name'].'\' border=\'0\'/></a></div>';
}else{
echo '<div id="featured_holder"><a href=\''.$playlink.'\'><img src=\''.$row1['thumburl'].'\' width=\'90\' height=\'90\' alt= \''.$row1['name'].'\' title= \''.$row1['name'].'\' border=\'0\'/></a></div>';
}

}
      }else{
echo'<div align="center">No Featured Games have been selected!</div>';
}
       echo'</div>';

templates/monster/styles.css
Find:
Code: [Select]
body{
font-family: Tahoma !important;
font-size: 12px !important;
padding: 0px;
margin: 0px;
color:#ffffff;
background:#0c0d0f;
}

Add Below:
Code: [Select]
#featured_holder {
float: left;
position: relative;
color: #FFF;
width: 90px;
height: 90px;
margin-left: 10px;
border: 2px ridge #FFF;
}

If your using the css switer mod, do this to all 4 styles.css

kratos

  • Newbie
  • *
  • Posts: 23
  • Force: +0/-0
Re: [Add On] Featured Games
« Reply #2 on: May 03, 2015, 10:17:49 AM »
This Add On will add Featured Games to your sidebar. Show your favorite or sponsored games!



Download zip and replace 2 files in pages/admin

log on to your cpanel, in phpmyadmin and run query
Code: [Select]
ALTER TABLE `fas_games` ADD `featured` tinyint(1) NOT NULL default '0' AFTER `belowgames`

Monster template edit template.php
Add:
Code: [Select]
include("templates/$template/blocks/featured.php");

Tiles Template edit includes/blocks.php
Add:
Code: [Select]
include("templates/$template/blocks/featured.php");

Copy and Paste featured code in a new file named ( featured.php ) for your template.
Monster:
Code: [Select]
<?php
echo'<div class="header">
Featured Games
</div>
<div class="content">'
;
$sqltitle='featuredgames' ;
$featured2 "SELECT * FROM fas_games WHERE active='1' AND featured='1' ORDER BY RAND () LIMIT 5";
$featured1 sqlcache($sqltitle$cachelife$featured2);
if(isset($featured1)){
       foreach($featured1 as $row1 ){
                
$gamename preg_replace('#\W#''-'$row1['name']);
if($row1['type'] == 1){
$img "<img src='".$domain."/".$thumbsfolder."/".$row1["thumb"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}else{
$img "<img src='".$row1["thumburl"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}

echo '<ul class=\'catmenu\'>
<li>'
;
                    if (
$seo_on == 1){
echo "<a href='".$domain."/play/".$row1["ID"]."-".$gamename.".html'>".$img.titlelimit($row1["name"])."</a>";
}else{
echo "<a href='".$domain."/index.php?action=play&amp;ID=" .$row1["ID"]. "'>".$img.titlelimit($row1["name"])."</a>";
}
echo '</li>
</ul>'
;
}
       }else{
echo'<div align="center">No games have been selected!</div>';
}
echo'</div>';
?>


Tiles:
Code: [Select]
<?php
echo'<div class="side_nav">Featured Games</div>
     <div id="side_holder">'
;
$sqltitle='featuredgames' ;
$featured2 "SELECT * FROM fas_games WHERE active='1' AND featured='1' ORDER BY RAND () LIMIT 5";
$featured1 sqlcache($sqltitle$cachelife$featured2);
if(isset($featured1)){
       foreach($featured1 as $row1 ){
                
$gamename preg_replace('#\W#''-'$row1['name']);
if($row1['type'] == 1){
$img "<img src='".$domain."/".$thumbsfolder."/".$row1["thumb"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}else{
$img "<img src='".$row1["thumburl"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}

echo '<ul class=\'catmenu\'>
<li>'
;
                    if (
$seo_on == 1){
echo "<a href='".$domain."/play/".$row1["ID"]."-".$gamename.".html'>".$img.titlelimit($row1["name"])."</a>";
}else{
echo "<a href='".$domain."/index.php?action=play&amp;ID=" .$row1["ID"]. "'>".$img.titlelimit($row1["name"])."</a>";
}
echo '</li>
</ul>'
;
}
       }else{
echo'<div align="center">No games have been selected!</div>';
}
echo
'</div>';
?>


Now login your arcade => admin => Manage Games => Selected games for your featured games.
i followed your instructions
i don't see a link to featured  games on admin panel.
Now login your arcade => admin => Manage Games => Selected games for your featured games.

am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
Re: [Add On] Featured Games
« Reply #3 on: May 03, 2015, 03:31:40 PM »
did you download the zip file for the admin pages?
you also have to edit the game and then select => Yes for featured

kratos

  • Newbie
  • *
  • Posts: 23
  • Force: +0/-0
Re: [Add On] Featured Games
« Reply #4 on: May 04, 2015, 05:05:56 AM »
works now thanks ;D

kizinew

  • Newbie
  • *
  • Posts: 10
  • Force: +0/-0
Re: [Add On] Featured Games
« Reply #5 on: June 22, 2016, 08:31:00 PM »
This Add On will add Featured Games to your sidebar. Show your favorite or sponsored games!



Download zip and replace 2 files in pages/admin

log on to your cpanel, in phpmyadmin and run query
Code: [Select]
ALTER TABLE `fas_games` ADD `featured` tinyint(1) NOT NULL default '0' AFTER `belowgames`

Monster template edit template.php
Add:
Code: [Select]
include("templates/$template/blocks/featured.php");

Tiles Template edit includes/blocks.php
Add:
Code: [Select]
include("templates/$template/blocks/featured.php");

Copy and Paste featured code in a new file named ( featured.php ) for your template.
Monster:
Code: [Select]
<?php
echo'<div class="header">
Featured Games
</div>
<div class="content">'
;
$sqltitle='featuredgames' ;
$featured2 "SELECT * FROM fas_games WHERE active='1' AND featured='1' ORDER BY RAND () LIMIT 5";
$featured1 sqlcache($sqltitle$cachelife$featured2);
if(isset($featured1)){
       foreach($featured1 as $row1 ){
                
$gamename preg_replace('#\W#''-'$row1['name']);
if($row1['type'] == 1){
$img "<img src='".$domain."/".$thumbsfolder."/".$row1["thumb"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}else{
$img "<img src='".$row1["thumburl"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}

echo '<ul class=\'catmenu\'>
<li>'
;
                    if (
$seo_on == 1){
echo "<a href='".$domain."/play/".$row1["ID"]."-".$gamename.".html'>".$img.titlelimit($row1["name"])."</a>";
}else{
echo "<a href='".$domain."/index.php?action=play&amp;ID=" .$row1["ID"]. "'>".$img.titlelimit($row1["name"])."</a>";
}
echo '</li>
</ul>'
;
}
       }else{
echo'<div align="center">No games have been selected!</div>';
}
echo'</div>';
?>


Tiles:
Code: [Select]
<?php
echo'<div class="side_nav">Featured Games</div>
     <div id="side_holder">'
;
$sqltitle='featuredgames' ;
$featured2 "SELECT * FROM fas_games WHERE active='1' AND featured='1' ORDER BY RAND () LIMIT 5";
$featured1 sqlcache($sqltitle$cachelife$featured2);
if(isset($featured1)){
       foreach($featured1 as $row1 ){
                
$gamename preg_replace('#\W#''-'$row1['name']);
if($row1['type'] == 1){
$img "<img src='".$domain."/".$thumbsfolder."/".$row1["thumb"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}else{
$img "<img src='".$row1["thumburl"]."' alt='".$gamename."' title='".$gamename."' class='minithumb' />";
}

echo '<ul class=\'catmenu\'>
<li>'
;
                    if (
$seo_on == 1){
echo "<a href='".$domain."/play/".$row1["ID"]."-".$gamename.".html'>".$img.titlelimit($row1["name"])."</a>";
}else{
echo "<a href='".$domain."/index.php?action=play&amp;ID=" .$row1["ID"]. "'>".$img.titlelimit($row1["name"])."</a>";
}
echo '</li>
</ul>'
;
}
       }else{
echo'<div align="center">No games have been selected!</div>';
}
echo
'</div>';
?>


Now login your arcade => admin => Manage Games => Selected games for your featured games.
I don't see the Tiles Template edit includes/blocks.php ( in Tiles Template no have "includes" folder)

am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
Re: [Add On] Featured Games
« Reply #6 on: June 25, 2016, 09:05:28 PM »
I don't see the Tiles Template edit includes/blocks.php ( in Tiles Template no have "includes" folder)

the includes folder is in the root of your directory