<?php if ($_POST) { include '../../config.php'; include '../../includes/core.php'; include '../secure.php'; if ($login_status != 1) { exit; } include '../admin_functions.php'; $name = escape($_POST['name']); $content = escape($_POST['content']); $tags = escape($_POST['meta_tags']); $seo_name = create_seoname($_POST['name'], $_POST['id'], 'news'); mysql_query("UPDATE ava_news SET title='{$name}', image='{$_POST['image']}', content='{$content}', seo_url = '{$seo_name}', meta_tags = '{$tags}' WHERE id='{$_POST['id']}'") or die(mysql_error()); header("Location: ../index.php?task=manage_news"); } else { if ($login_status != 1) { exit; } $sql = mysql_query("SELECT * FROM ava_news WHERE id=" . $_GET['id'] . ""); $row = mysql_fetch_array($sql); ?> <head><script language="javascript" type="text/javascript" src="<?php echo $setting['site_url']; ?> /admin/js/wyzz.js"></script> </head> <body> <form id="form1" name="form1" method="post" action="pages/edit_news.php">
include '../admin_functions.php'; include '../secure.php'; if ($login_status != 1) { exit; } $forum_name = escape($_POST['forum_name']); $forum_description = escape($_POST['forum_description']); $parent_forums = GetForumParents($_POST['parent_forum']); if (!isset($_POST['read_only'])) { $_POST['read_only'] = 0; } if ($_POST['id'] == 0) { $seo_url = create_seoname($_POST['forum_name'], 0, 'forum'); mysql_query("INSERT INTO ava_forums (name, description, forum_order, parent_id, parents, seo_url, read_only) VALUES ('{$forum_name}', '{$forum_description}', 1, {$_POST['parent_forum']}, '{$parent_forums}', '{$seo_url}', '{$_POST['read_only']}')"); } else { $seo_url = create_seoname($_POST['forum_name'], $_POST['id'], 'forum'); mysql_query("UPDATE ava_forums SET name = '{$forum_name}', description = '{$forum_description}', parent_id = '{$_POST['parent_forum']}', parents = '{$parent_forums}', seo_url = '{$seo_url}', read_only = '{$_POST['read_only']}' WHERE id = {$_POST['id']}") or die(mysql_error()); } $all_forums = mysql_query("SELECT * FROM ava_forums"); while ($forum = mysql_fetch_array($all_forums)) { $parents = ''; $parent_forums = GetForumParents($forum['parent_id']); $parents = ''; $child_forums = GetForumParents($forum['id'], 'children'); mysql_query("UPDATE ava_forums SET parents = '{$parent_forums}', children = '{$child_forums}' WHERE id = {$forum['id']}"); } function GetForumParents($first, $type = 'parents') { global $parents; if (!isset($parents)) { $parents = '';
$seo_url = create_seoname($_POST['name'], $_POST['id'], 'category'); if ($_POST['parent_id'] != 0) { $parent = mysql_fetch_array(mysql_query("SELECT cat_order FROM ava_cats WHERE id = {$_POST['parent_id']}")); $cat_order = intval($parent['cat_order']) . '.1'; $update_cat_order = "cat_order = '{$cat_order}',"; } else { $update_cat_order = ''; } mysql_query("UPDATE ava_cats SET name='{$name}', {$update_cat_order} description = '{$description}', keywords = '{$_POST['keywords']}', seo_url = '{$seo_url}', parent_id = {$_POST['parent_id']} WHERE id='{$_POST['id']}'"); mysql_query("UPDATE ava_games SET category_parent = {$_POST['parent_id']} WHERE category_id = {$_POST['id']}"); } else { if ($_POST['parent_id'] == 0) { $cat_order = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM ava_cats WHERE parent_id = 0"), 0) + 1; } else { $parent = mysql_fetch_array(mysql_query("SELECT cat_order FROM ava_cats WHERE id = {$_POST['parent_id']}")); $cat_order = intval($parent['cat_order']) . '.1'; } $seo_url = create_seoname($_POST['name'], 0, 'category'); mysql_query("INSERT INTO ava_cats (name, cat_order, description, keywords, seo_url, parent_id)\n\tVALUES ('{$name}', {$cat_order}, '{$description}', '{$_POST['keywords']}', '{$seo_url}', {$_POST['parent_id']})") or die('There was a MySql error when adding the category: ' . mysql_error()); $newid = mysql_insert_id(); $url = CategoryUrl($newid, $seo_url, 1, 'newest'); echo '<div id="category-' . $newid . '" class="manage_item_new"><div class="manage_column0">' . $newid . '</div><div id="category-name-' . $newid . '" class="manage_column"><a href="' . $url . '" class="manage_link">' . $_POST['name'] . '</a></div><div class="manage_column3" id="delete-image-' . $newid . '"><img src="images/delete.png" width="24" height="24" onclick="DeleteAsk(' . $newid . ');"></div><div class="manage_column3" id="edit-image-' . $newid . '"><img src="images/edit.png" width="24" height="24" onclick="EditCategory(' . $newid . ', '; echo "'" . $_POST['name'] . "'"; echo ');"></div> <div class="manage_column_totalgames"><a href="?task=manage_games#page=1&cat=' . $newid . '">0</a></div> <div class="order_column"><input type="text" onfocus="EditOrderDefault(' . $newid . ')" onchange="EditOrderSubmit(' . $newid . ');" class="category_order_text_box" value="' . $cat_order . '" name="order_box' . $newid . '" id="order_box' . $newid . '"></div> <div id="edit-category-' . $newid . '" class="edit_game_container"></div></div>'; }
<?php if ($_POST) { include '../../config.php'; include '../../includes/core.php'; include '../secure.php'; if ($login_status != 1) { exit; } include '../admin_functions.php'; $name = escape($_POST['name']); $content = escape($_POST['content']); $tags = escape($_POST['meta_tags']); $seo_name = create_seoname($_POST['name'], 0, 'page'); mysql_query("INSERT INTO ava_pages (name, page, menu, seo_url, meta_tags) VALUES ('{$name}', '{$content}', {$_POST['menu']}, '{$seo_name}', '{$tags}')") or die(mysql_error()); header("Location: ../index.php?task=manage_pages"); } else { if ($login_status != 1) { exit; } ?> <head><script language="javascript" type="text/javascript" src="<?php echo $setting['site_url']; ?> /admin/js/wyzz.js"></script> </head> <body> <form id="form1" name="form1" method="post" action="pages/add_page.php"> <div class="page_label">Page title</div> <input name="name" type="text" size="30" class="page_title" />
fclose($new_thumb); $url = $setting['site_url'] . '/games/' . $filename . '.swf'; $thumb_url = $setting['site_url'] . '/games/images/' . $filename . '.' . $ext; } else { $url = escape($game['swf_url']); $thumb_url = escape($game['thumbnail_url']); } } if ($game['leaderboard_enabled'] == true) { $highscores = 1; } else { $highscores = 0; } $date = date("Y-m-d H:i:s"); $default_ad = $feed_setting['default_ad']; $seo_url = create_seoname($name, 0, 'game'); mysql_query("INSERT INTO ava_games (name, description, url, category_id, published, filetype, width, height, image, instructions , mochi, date_added, advert_id, highscores, mochi_id, seo_url)\nVALUES ('{$name}', '{$description}', '{$url}', '{$category}', 1, 'swf', '{$game['width']}', '{$game['height']}', '{$thumb_url}', '{$instructions}', 1, '{$date}', {$default_ad}, {$highscores}, '{$game['game_tag']}', '{$seo_url}')") or die(mysql_error()); $new_id = mysql_insert_id(); mysql_query("UPDATE ava_mochi SET visible='2' WHERE gametag='{$game['game_tag']}'"); $tag_list = ''; $ti = 0; print_r($game['tags']); foreach ($game['tags'] as $game_tags) { if ($ti == 1) { $tag_list = $tag_list . ',' . $game_tags; } else { $tag_list = $tag_list . $game_tags; $ti = 1; } } // Add game tags
$valid_extensions = array('png', 'jpg', 'jpeg', 'gif', 'PNG', 'JPG', 'JPEG', 'GIF'); if (!in_array($ext, $valid_extensions)) { $ext = 'png'; } $url = $fgd_game['file_url']; $thumb_url = $fgd_game['thumb_url']; if ($feed_setting['download'] == 1) { if ($feed_setting['curl'] == 1) { $game = curl($url); $thumb = curl($thumb_url); $get_type = 'cURL'; } else { $game = file_get_contents($url); $thumb = file_get_contents($thumb_url); } $new_file = fopen("../../../games/{$filename}.swf", "wb"); fwrite($new_file, $game); fclose($new_file); $new_thumb = fopen("../../../games/images/{$filename}.{$ext}", "wb"); fwrite($new_thumb, $thumb); fclose($new_thumb); $url = $setting['site_url'] . '/games/' . $filename . '.swf'; $thumb_url = $setting['site_url'] . '/games/images/' . $filename . '.' . $ext; } $date = date("Y-m-d H:i:s"); $default_ad = $feed_setting['default_ad']; $seo_url = create_seoname($fgd_game['name'], 0, 'game'); mysql_query("INSERT INTO ava_games (name, description, url, category_id, published, filetype, width, height, image, date_added, advert_id, seo_url) \nVALUES ('{$name}', '{$description}', '{$url}', '{$category_id}', 1, 'swf', '{$fgd_game['width']}', '{$fgd_game['height']}', '{$thumb_url}', '{$date}', '{$default_ad}', '{$seo_url}')") or die(mysql_error()); $new_id = mysql_insert_id(); mysql_query("UPDATE ava_fgd SET visible='2' WHERE id='{$fgd_game['id']}'"); echo '{"success":1,"new_id":' . $new_id . '}';
} else { $game = file_get_contents($mochi_game['file_url']); $thumb = file_get_contents($mochi_game['thumb_url']); } $new_file = fopen("../../../games/{$filename}.swf", "wb"); fwrite($new_file, $game); fclose($new_file); $new_thumb = fopen("../../../games/images/{$filename}.{$ext}", "wb"); fwrite($new_thumb, $thumb); fclose($new_thumb); $url = $setting['site_url'] . '/games/' . $filename . '.swf'; $thumb_url = $setting['site_url'] . '/games/images/' . $filename . '.' . $ext; } else { $url = escape($mochi_game['file_url']); $thumb_url = escape($mochi_game['thumb_url']); } $date = date("Y-m-d H:i:s"); $default_ad = $feed_setting['default_ad']; $seo_url = create_seoname($mochi_game['name'], 0, 'game'); mysql_query("INSERT INTO ava_games (name, description, url, category_id, published, filetype, width, height, image, instructions, mochi, date_added, advert_id, highscores, mochi_id, seo_url) \nVALUES ('{$name}', '{$description}', '{$url}', '{$category_id}', 1, 'swf', '{$mochi_game['width']}', '{$mochi_game['height']}', '{$thumb_url}', '{$instructions}', 1, '{$date}', {$default_ad}, {$mochi_game['highscores']}, '{$mochi_game['gametag']}', '{$seo_url}')"); $new_id = mysql_insert_id(); mysql_query("UPDATE ava_mochi SET visible='2' WHERE id='{$mochi_game['id']}'"); if ($feed_setting['get_tags'] == 1) { // Add game tags $tags = str_replace(" ", "", $mochi_game['tags']); $tag_array = explode(",", $tags); add_tags($tag_array, $new_id); $thisismochi = 1; include '../../includes/tagcloud_gen.php'; } echo '{"success":1,"new_id":' . $new_id . '}';
if (!in_array($ext, $valid_extensions)) { $ext = 'png'; } if ($feed_setting['download'] == 1) { if ($feed_setting['curl'] == 1) { $game = curl($spil_game['file_url']); $thumb = curl($spil_game['thumb_url']); $get_type = 'cURL'; } else { $game = file_get_contents($spil_game['file_url']); $thumb = file_get_contents($spil_game['thumb_url']); } $new_file = fopen("../../../games/{$filename}.swf", "wb"); fwrite($new_file, $game); fclose($new_file); $new_thumb = fopen("../../../games/images/{$filename}.{$ext}", "wb"); fwrite($new_thumb, $thumb); fclose($new_thumb); $url = $setting['site_url'] . '/games/' . $filename . '.swf'; $thumb_url = $setting['site_url'] . '/games/images/' . $filename . '.' . $ext; } else { $url = escape($spil_game['file_url']); $thumb_url = escape($spil_game['thumb_url']); } $date = date("Y-m-d H:i:s"); $default_ad = $feed_setting['default_ad']; $seo_url = create_seoname($spil_game['name'], 0, 'game'); mysql_query("INSERT INTO ava_games (name, description, url, category_id, published, filetype, width, height, image, instructions, date_added, advert_id, mochi_id, seo_url) \nVALUES ('{$name}', '{$description}', '{$url}', '{$category_id}', 1, 'swf', '{$spil_game['width']}', '{$spil_game['height']}', '{$thumb_url}', '{$instructions}', '{$date}', {$default_ad}, '', '{$seo_url}')"); $new_id = mysql_insert_id(); mysql_query("UPDATE ava_spil SET visible='2' WHERE id='{$spil_game['id']}'"); echo '{"success":1,"new_id":' . $new_id . '}';
} else { // Send back the newly added game container if not submitted from homepage $url = GameUrl($newid, $seo_url, $category['id']); echo ' <div id="game-' . $newid . '" class="manage_item_new"><div class="manage_column0">' . $newid . '</div><div id="tgame_name' . $newid . '" class="' . $link_class . '"><a href="' . $url . '" class="manage_link">' . stripslashes($_POST['game_name']) . '</a></div><div id="tcategory_name' . $newid . '" class="manage_column2">' . $category['name'] . '</div><div class="manage_column3" id="edit-image-' . $newid . '"><img src="images/edit.png" width="24" height="24" onclick="edit_game(' . $newid . ');"></div><div class="manage_column3" id="delete-image-' . $newid . '"><img src="images/delete.png" width="24" height="24" onclick="DeleteAsk(' . $newid . ');"></div><div class="manage_column3" id="feature_icon' . $newid . '"><img src="images/feature.png" width="24" height="24" onclick="FeatureGame(' . $newid . ', 1);"></div>'; if ($_POST['published'] == 1) { echo '<div class="manage_column3" id="published-image-' . $newid . '"><img src="images/published.png" width="24" height="24" onclick="TogglePublished(' . $newid . ', 0);"></div>'; } else { echo '<div class="manage_column3" id="published-image-' . $newid . '"><img src="images/unpublished.png" width="24" height="24" onclick="TogglePublished(' . $newid . ', 1);"></div>'; } echo '<div class="manage_column4" id="comments-image-' . $newid . '"><img src="images/comments.gif" width="24" height="24" onclick="gotourl(\'index.php?task=manage_comments#page=1&id=' . $newid . '\')"></div>'; if ($_POST['highscores'] == 1) { echo '<div class="manage_column3" id="delete-image-' . $newid . '"><img src="images/highscores.png" width="22" height="23" onclick="gotourl(\'?task=manage_highscores&id=' . $newid . '#page=1&leaderboard=default&game=' . $newid . '\')"></div>'; } echo '<div id="edit-game-' . $newid . '" class="edit_game_container"></div></div>'; } } else { $seo_url = create_seoname($name, $_POST['id'], 'game'); mysql_query("UPDATE ava_games SET name='" . escape($_POST['game_name']) . "', description='" . escape($_POST['game_description']) . "', url='{$url}', category_id= {$_POST['game_category']}, category_parent='{$category['parent_id']}', width='{$_POST['width']}', height='{$_POST['height']}', image='{$img}', published='{$_POST['published']}', filetype='{$ext}', instructions='" . escape($_POST['game_instructions']) . "', advert_id = {$_POST['game_advert']}, highscores = {$_POST['highscores']}, mochi_id = '{$_POST['mochi_id']}', seo_url = '{$seo_url}', submitter = '{$_POST['submitter']}', html_code = '{$code}' WHERE id='" . $_POST['id'] . "'") or die(mysql_error()); echo 'Success'; $newid = $_POST['id']; mysql_query("DELETE FROM ava_tag_relations WHERE game_id='{$newid}'"); } // Add game tags if ($_POST['tags'] != '') { $tags = str_replace(" ", " ", $_POST['tags']); $tags = str_replace(", ", ",", $_POST['tags']); $tag_array = explode(",", $tags); add_tags($tag_array, $newid); } include 'tagcloud_gen.php';
$thumb = curl($playtomic_game['thumb_url']); $get_type = 'cURL'; } else { $game = file_get_contents($playtomic_game['file_url']); $thumb = file_get_contents($playtomic_game['thumb_url']); } $new_file = fopen("../../../games/{$filename}.swf", "wb"); fwrite($new_file, $game); fclose($new_file); $new_thumb = fopen("../../../games/images/{$filename}.{$ext}", "wb"); fwrite($new_thumb, $thumb); fclose($new_thumb); $url = $setting['site_url'] . '/games/' . $filename . '.swf'; $thumb_url = $setting['site_url'] . '/games/images/' . $filename . '.' . $ext; } else { $url = escape($playtomic_game['file_url']); $thumb_url = escape($playtomic_game['thumb_url']); } $date = date("Y-m-d H:i:s"); $default_ad = $feed_setting['default_ad']; $seo_url = create_seoname($playtomic_game['name'], 0, 'game'); mysql_query("INSERT INTO ava_games (name, description, url, category_id, published, filetype, width, height, image, instructions, mochi, date_added, advert_id, highscores, mochi_id, seo_url) \nVALUES ('{$name}', '{$description}', '{$url}', '{$category_id}', 1, 'swf', '{$playtomic_game['width']}', '{$playtomic_game['height']}', '{$thumb_url}', '{$instructions}', 1, '{$date}', {$default_ad}, {$playtomic_game['highscores']}, '{$playtomic_game['gametag']}', '{$seo_url}')"); $new_id = mysql_insert_id(); mysql_query("UPDATE ava_playtomic SET visible='2' WHERE id='{$playtomic_game['id']}'"); if ($feed_setting['get_tags'] == 1) { // Add game tags $tags = str_replace(" ", "", $playtomic_game['tags']); $tag_array = explode(",", $tags); add_tags($tag_array, $new_id); } echo '{"success":1,"new_id":' . $new_id . '}';