Jump to content

Help me with this mod


assault14

Recommended Posts

thanks. i just realised that there is goin to be a issue with the code.

 

this is wat i need modied...

 

this is how my admin system look atm - 92633835.th.jpg

 

this is how i want it to look like with the rss feature - 69627312.th.jpg

 

basically when i go to submit a new tv show. i would check if i want to do be done automatically or if i want to do it manually. and if i want it done automatically then i insert the rss feed. and the category it belongs to. and then it would automatically pull the links and titles from the feed and post them on my site. and it would check for new episodes once a day or once a week. please help me with this.

 

here is an exmple of the rss feed i would be using

 

http://feeds2.feedburner.com/csi?format=xml

 

here is the source

 

<?php

require_once "../maincore.php";
require_once THEMES."templates/admin_header.php";
require_once INCLUDES."html_buttons_include.php";
include LOCALE.LOCALESET."admin/tv-shows.php";

if (!checkrights("W") || !defined("iAUTH") || $_GET['aid'] != iAUTH) redirect("../index.php");

if (isset($_GET['status']) && !isset($message)) {
if ($_GET['status'] == "sn") {
	$message = $locale['510'];
} elseif ($_GET['status'] == "su") {
	$message = $locale['511'];
} elseif ($_GET['status'] == "del") {
	$message = $locale['512'];
}
if ($message) {	echo "<div class='admin-message'>".$message."</div>\n"; }
}

$result = dbquery("SELECT * FROM tv_show_cats");
if (dbrows($result)) {
if ((isset($_GET['action']) && $_GET['action'] == "delete") && (isset($_GET['show_id']) && isnum($_GET['show_id']))) {
	$result = dbquery("DELETE FROM tv_shows WHERE show_id='".$_GET['show_id']."'");
	redirect(FUSION_SELF.$aidlink."&show_cat_id=".$_GET['show_cat_id']."&status=del");
}
if (isset($_POST['save_link'])) {
	$show_name = stripinput($_POST['show_name']);
	$show_description = addslash($_POST['show_description']);
	$show_url = stripinput($_POST['show_url']);
	$show_cat = intval($_POST['show_cat']);
	if ($show_name) {
		if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['show_id']) && isnum($_GET['show_id']))) {
			$show_datestamp = isset($_POST['update_datestamp']) ? ", show_datestamp='".time()."'" : "";
			$result = dbquery("UPDATE tv_shows SET show_name='$show_name', show_description='$show_description', show_url='$show_url', show_cat='$show_cat'".$show_datestamp." WHERE show_id='".$_GET['show_id']."'");
			redirect(FUSION_SELF.$aidlink."&show_cat_id=$show_cat&status=su");
		} else {
			$result = dbquery("INSERT INTO tv_shows (show_name, show_description, show_url, show_cat, show_datestamp, show_count) VALUES ('$show_name', '$show_description', '$show_url', '$show_cat', '".time()."', '0')");
			redirect(FUSION_SELF.$aidlink."&show_cat_id=$show_cat&status=sn");
		}
	} else {
		redirect(FUSION_SELF.$aidlink);
	}
}
if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['show_id']) && isnum($_GET['show_id']))) {
	$result = dbquery("SELECT * FROM tv_shows WHERE show_id='".$_GET['show_id']."'");
	if (dbrows($result)) {
		$data = dbarray($result);
		$show_name = $data['show_name'];
		$show_description = stripslashes($data['show_description']);
		$show_url = $data['show_url'];
		$show_cat = $data['show_cat'];
		$formaction = FUSION_SELF.$aidlink."&action=edit&show_id=".$data['show_id'];
		opentable($locale['501']);
	} else {
		redirect(FUSION_SELF.$aidlink);
	}
} else {
	$show_name = "";
	$show_description = "";
	$show_url = "http://";
	$show_cat = "";
	$formaction = FUSION_SELF.$aidlink;
	opentable($locale['500']);
}
$editlist = ""; $sel = "";
$result2 = dbquery("SELECT * FROM tv_show_cats ORDER BY show_cat_name");
if (dbrows($result2) != 0) {
	while ($data2 = dbarray($result2)) {
		if (isset($_GET['action']) && $_GET['action'] == "edit") { $sel = ($show_cat == $data2['show_cat_id'] ? " selected='selected'" : ""); }
		$editlist .= "<option value='".$data2['show_cat_id']."'$sel>".$data2['show_cat_name']."</option>\n";
	}
}
echo "<form name='inputform' method='post' action='".$formaction."'>\n";
echo "<table width='460' cellspacing='0' cellpadding='0' class='center'>\n<tr>\n";
echo "<td width='80' class='tbl'>".$locale['520']."</td>\n";
echo "<td class='tbl'><input type='text' name='show_name' value='".$show_name."' class='textbox' style='width:380px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td valign='top' width='80' class='tbl'>".$locale['521']."</td>\n";
echo "<td class='tbl'><textarea name='show_description' cols='60' rows='5' class='textbox' style='width:380px;'>".$show_description."</textarea></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'></td><td class='tbl'>\n";
echo display_html("inputform", "show_description", true)."</td>\n";
echo "</tr>\n<tr>\n";
echo "<td width='80' class='tbl'>".$locale['522']."</td>\n";
echo "<td class='tbl'><input type='text' name='show_url' value='".$show_url."' class='textbox' style='width:380px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td width='80' class='tbl'>".$locale['523']."</td>\n";
echo "<td class='tbl'><select name='show_cat' class='textbox' style='width:150px;'>\n".$editlist."</select></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='center' colspan='2' class='tbl'>";
if (isset($_GET['action']) && $_GET['action'] == "edit") {
	echo "<input type='checkbox' name='update_datestamp' value='1'> ".$locale['524']."<br /><br />\n";
}
echo "<input type='submit' name='save_link' value='".$locale['525']."' class='button' /></td>\n";
echo "</tr>\n</table>\n</form>\n";
closetable();

opentable($locale['502']);
echo "<table cellpadding='0' cellspacing='0' width='400' class='center'>\n";
$result = dbquery("SELECT * FROM tv_show_cats ORDER BY show_cat_name");
if (dbrows($result)) {
	echo "<tr>\n";
	echo "<td class='tbl2'>".$locale['531']."</td>\n";
	echo "<td align='right' class='tbl2'>".$locale['532']."</td>\n";
	echo "</tr>\n<tr>\n";
	echo "<td colspan='2' height='1'></td>\n";
	echo "</tr>\n";
	while ($data = dbarray($result)) {
		if (!isset($_GET['show_cat_id']) || !isnum($_GET['show_cat_id'])) { $_GET['show_cat_id'] = 0; }
		if ($data['show_cat_id'] == $_GET['show_cat_id']) { $p_img = "off"; $div = ""; } else { $p_img = "on"; $div = "style='display:none'"; }
		echo "<tr>\n";
		echo "<td class='tbl2'>".$data['show_cat_name']."</td>\n";
		echo "<td class='tbl2' align='right'><img src='".get_image("panel_$p_img")."' alt='' name='b_".$data['show_cat_id']."' onclick=\"javascript:flipBox('".$data['show_cat_id']."')\" /></td>\n";
		echo "</tr>\n";
		$result2 = dbquery("SELECT * FROM tv_shows WHERE show_cat='".$data['show_cat_id']."' ORDER BY show_name");
		if (dbrows($result2)) {
			echo "<tr>\n<td colspan='2'>\n";
			echo "<div id='box_".$data['show_cat_id']."'".$div.">\n";
			echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
			while ($data2 = dbarray($result2)) {
				echo "<tr>\n";
				echo "<td class='tbl'><a href='$data2[show_url]' target='_blank'>".$data2['show_name']."</a></td>\n";
				echo "<td width='75' class='tbl'><a href='".FUSION_SELF.$aidlink."&action=edit&show_cat_id=".$data['show_cat_id']."&show_id=".$data2['show_id']."'>".$locale['533']."</a> -\n";
				echo "<a href='".FUSION_SELF.$aidlink."&action=delete&show_cat_id=".$data['show_cat_id']."&show_id=".$data2['show_id']."' onclick=\"return confirm('".$locale['550']."');\">".$locale['534']."</a></td>\n";
				echo "</tr>\n";
			}
			echo "</table>\n</div>\n</td>\n</tr>\n";
		} else {
			echo "<tr>\n<td colspan='2'>\n";
			echo "<div id='box_".$data['show_cat_id']."' style='display:none'>\n";
			echo "<table width='100%' cellspacing='0' cellpadding='0'>\n<tr>\n";
			echo "<td class='tbl'>".$locale['535']."</td>\n";
			echo "</tr>\n</table>\n</div>\n</td>\n</tr>\n";
		}
	}
	echo "</table>\n";
}
closetable();
} else {
opentable($locale['536']);
echo "<div style='text-align:center'>".$locale['537']."<br />\n".$locale['538']."<br />\n<br />\n";
echo "<a href='tv-shows_cats.php".$aidlink."'>".$locale['539']."</a>".$locale['540']."</div>\n";
closetable();
}

require_once THEMES."templates/footer.php";
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.