Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Yuna Scatari Edition (YSE)
Reply
  #1  
Old 22nd May 2012, 15:16
mat22 mat22 is offline
Senior Member
 
Join Date: Jun 2009
Latvia
Posts: 119
Default Premiere movies - can't edit info
Hello BVList!
So I've had this problem for some while and now I'm getting really angry becuase I just can't figure it out. The problem is, I have a section called "Movies" in a tracker where I add all new movies like "Battleship", "Puss in Boots" etc. But! I can't edit information about them. I write everything how it needs to be, press "Edit", it shows that everything is ok but when it redirects me to actual filmas.php (movies.php in english) everything is just like before.

I haven't been able to figure out the problem. Actually - none of the people who looked at those php files weren't able to figure it out. Maybe we are just stupid but I'll let you see that. I added those files as attachments.

P.S. filmasedit.php is the actual file that I open in tracker to edit them. Takefilmas.php is the thing that sends stuff to database. I have stuff that adds new movie to database too in that file.

P.S.S. And maybe someone has any ideas how to make that section look better? Because it now looks shitty. You can see it in a picture I attached.
Attached Thumbnails
movie section.png  
Attached Files
File Type: php filmasedit.php (3.0 KB, 42 views)
File Type: php takefilmas.php (4.6 KB, 22 views)
Reply With Quote
  #2  
Old 22nd May 2012, 15:31
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
Please if you can tell me what message you get when you send the edit to takefilmas.php
and show me what the address looks like in the address bar.
Also I need to know what php version your using in your server.
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #3  
Old 23rd May 2012, 12:20
mat22 mat22 is offline
Senior Member
 
Join Date: Jun 2009
Latvia
Posts: 119
Default
Quote:
Originally Posted by joeroberts View Post
Please if you can tell me what message you get when you send the edit to takefilmas.php
and show me what the address looks like in the address bar.
Also I need to know what php version your using in your server.
I added attachment to this reply with the message I get when I edit the movie. You can see address too.

And php version is "php-5.2.17-13". The problem probably is that I'm just dumb.:D

P.S. Hope you won't think that I'm spamming with that screenshot.:-|
Attached Thumbnails
takefilmas screenshot.png  
Reply With Quote
  #4  
Old 23rd May 2012, 16:35
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
the problem was the ID of the Premiere was not being forwarded to Takefilmas.php so try this
filmasedit.php
PHP Code:
<?
require "include/bittorrent.php";
dbconn();
loggedinorreturn();

$id abs($_GET['id']);
if (empty(
$_GET['id'])||!is_numeric($_GET['id']))
stderr_in("Kļūdа""Nederīgs ID");

$res sql_query("SELECT * FROM premieres WHERE id = $id");
$row mysql_fetch_array($res);
if (!
$row)
    die();

stdhead("Rediģēt Filmu");
print(
"<table align=\"center\" width=100% class=main border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>");
print(
"<center><h2>Labot Filmas Informāciju</h2></center>");
print (
"</td></tr></table>");
print(
"<table align=\"center\" width=100% border=1 cellspacing=0 cellpadding=10><tr><td class=text align=\"center\">");
print(
"<form enctype=\"multipart/form-data\" action=\"takefilmas.php?p=change\" method=\"post\">\n<input type=\"hidden\" name=\"id\" value=\"".$row['id']."\" />\n");
print(
"<table align=\"center\" border=1 cellspacing=0 cellpadding=5>");
print(
"<tr><td>Nosaukums:</td><td><input type=\"text\" name=\"name\" value=\""$row['name'] ."\" size=\"77\"><br><u>Piemērs: <b>Laba meitene</b></u></td></tr>");
print(
"<tr><td>Oriģinālais nosaukums:</td><td><input type=\"text\" name=\"ori_name\" value=\""$row['ori_name'] ."\" size=\"77\"><br><u>Piemērs: <b>Good girl</b></u></td></tr>");
print(
"<tr><td>Bilde:</td><td><input type=\"text\" value=\""$row['poster'] ."\"  name=\"poster\" size=\"77\"><br><u>Piemērs: <b>$DEFAULTBASEURL/posters/image.gif</b></u></td></tr>");
print(
"<tr><td>Filmas žanrs:</td><td><input type=\"text\" value=\""$row['genre'] ."\"  name=\"genre\" size=\"25\"><br><u>Piemērs: <b>Komēdija</b></u></td></tr>");
print(
"<td>Gads:</td>");
print(
"<td>");
print(
"<select name=\"year\" value=\""$row['year'] ."\">");
print(
"<option value=\"0\">-</option>");
print(
"<option value=\"2010\">2010</option>");
print(
"<option value=\"2011\">2011</option>");
print(
"<option value=\"2012\">2012</option>");
print(
"<option value=\"2013\">2013</option>");
print(
"<option value=\"2014\">2014</option>");
print(
"<option value=\"2015\">2015</option>");
print(
"<option value=\"2016\">2016</option>");
print(
"<option value=\"2017\">2017</option>");
print(
"<option value=\"2018\">2018</option>");
print(
"<option value=\"2019\">2019</option>");
print(
"<option value=\"2020\">2020</option>");
print(
"</select>");
print(
"</tr>");
print(
"<tr><td>Apraksts:</td><td><textarea name=\"descr\" rows=\"10\" cols=\"80\">" $row['descr'] . "</textarea></td></tr>");
print(
"<tr><td>YT Trailer:</td><td><input type=\"text\" name=\"url\" value=\""$row['url'] ."\" size=\"77\"><br><u>Piemērs: <b>http://www.youtube.com/watch?v=ISJR4rVO0TQ</b></u></td></tr>");
print(
"<tr><td>IMDB:</td><td><INPUT type=\"text\" name=\"imdb\"  value=\""$row['imdb'] ."\" size=\"83\"></td></tr>");

/* --- IFDB links ---
print("<tr><td>IFDB:</td><td><INPUT type=\"text\" name=\"ifdb\"  value=\"". $row['ifdb'] ."\" size=\"83\"></td></tr>");
--- End --- */

print("<tr><td colspan=2 align=center><input type=submit name=Submit value=\"Pievienot\" class=btn></td></tr>");
print(
"</table>");
print(
"</form>");
print(
"<p>");
print(
"</td></tr>");
print (
"</td></tr></table>");
stdfoot();
?>
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #5  
Old 23rd May 2012, 19:25
mat22 mat22 is offline
Senior Member
 
Join Date: Jun 2009
Latvia
Posts: 119
Default
Still same problem. It shows me that the film is edited but everything stays same. No errors or anything. I got this script from original Yuna forum but there wasn't editing included so I added it myself. Maybe I should try moving editing part to another file? Is there a chance it's just conflicting with adding movie somehow?
Reply With Quote
  #6  
Old 24th May 2012, 06:20
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
along with the last edit I gave you try this
takefilmas.php

PHP Code:
<?

require_once("include/bittorrent.php");
dbconn(true);
loggedinorreturn();

function 
bark($msg) {
    
genbark($msg$tracker_lang['error']);
}
#### Bonusi par pievienošanu ####
$use_bonus '0'// Ieslēgts? 1 = Jā / 0 = Nē
$nr '1'// Bonusu skaits
###############################

$premiere = (string)$_GET['p'];

if(
$premiere == 'change'){
$id = (int)$_POST['id'];
$name unesc($_POST["name"]);
if (!
$name)
    
bark("Jums jāievada nosaukums!");
$oriname unesc($_POST["ori_name"]);
if (!
$oriname)
    
bark("Jums jāievada oriģinālais nosaukums!");
$poster unesc($_POST["poster"]);
if (!
$poster)
    
bark("Jums jāievada bildes url!");    
$genre unesc($_POST["genre"]);
if (!
$genre)
    
bark("Jums jāievada žanrs!");
if (
strlen($genre) > 60)
    
bark("kļūda, Esat ievadījis pārāk garu žanru (Max - 60)");
$year unesc($_POST["year"]);
if (!
$year)
    
bark("Jums jāievada gads!");
$descr unesc($_POST["descr"]);
if (!
$descr)
    
bark("Jums jāievada apraksts!");    

$imdb unesc($_POST["imdb"]);
if (!
$imdb)
    
bark("Jums jāievada IMDB adrese!");
$url unesc($_POST["url"]);
if (!
$imdb)
    
bark("Jums jāievada YouTube trailera adrese!");

$fposter htmlspecialchars($poster);
$fname htmlspecialchars($name);
$foriname htmlspecialchars($oriname);
$fyear htmlspecialchars($year);
$fgenre htmlspecialchars($genre);
$owner = (int)$CURUSER['id'];
    
$sql 'UPDATE `premieres` SET `name` = "'.$fname.'", `poster` = "'.$fposter.'", `genre` = "'.$fgenre.'", `year` = "'.$fyear.'", `descr` = "'.$descr.'", `imdb` = "'.$imdb.'", `owner` = "'.$owner.'", `url` = "'.$url.'", `ori_name` = "'.$foriname.'" WHERE `id` = "'.$id.'"';
$change mysql_query($sql) or sqlerr(__FILE__,__LINE__);

if(
$change){
header("Refresh: 2; url=/filmas.php");
stderr("Veiksmīgi "," Jūs esat izlabojis filmu,");
}else{
header("Refresh: 2; url=/filmas.php");
stderr("Kļūda""Nevar labot filmu");
}
}

/* Filmas resets. Fīča, kas nav vajadzīga un nekur netiek pielietota.
if($premiere == 'reset'){
if (get_user_class() < UC_MODERATOR)
    stderr($tracker_lang['error'], $tracker_lang['access_denied']);
$reset = sql_query("UPDATE premieres SET uploaded = 'no' WHERE id = $id");
$reset = sql_query("UPDATE premieres SET url = '' WHERE id = $id");    
if($reset == 'true'){
header("Refresh: 2; url=/filmas_new.php");
stderr("Veiksmīgi "," Jūs esat veiksmīgi izmainījis filmu");
}else{
header("Refresh: 2; url=/filmas_new.php");
stderr("Kļūda", "Neizdevās izmainīt filmu");
}
}
*/

if($premiere == 'delete'){
$id = (int)$_GET['id'];
$preid mysql_query("SELECT owner FROM premieres WHERE id=$id");
$arpreid mysql_fetch_array($preid);
if(
get_user_class() >= UC_MODERATOR || $CURUSER["id"] == $arpreid["owner"])
{
$delete sql_query("DELETE FROM premieres WHERE id = $id");
if(
$delete == 'true'){
header("Refresh: 2; url=/filmas.php");
stderr("Veiksmīgi""Veiksmīgi izdzēsts");
}else{
header("Refresh: 2; url=/filmas.php");
stderr("Kļūda""Nevar dzēst filmu");
}
}else{
die();
}
}

if(
$premiere == 'add'){

$name unesc($_POST["name"]);
if (!
$name)
    
bark("Jums jāievada nosaukums!");
$oriname unesc($_POST["ori_name"]);
if (!
$oriname)
    
bark("Jums jāievada oriģinālais nosaukums!");
$poster unesc($_POST["poster"]);
if (!
$poster)
    
bark("Jums jāievada bildes url!");    
$genre unesc($_POST["genre"]);
if (!
$genre)
    
bark("Jums jāievada žanrs!");
if (
strlen($genre) > 60)
    
bark("kļūda, Esat ievadījis pārāk garš žanru (Max - 60)");
$year unesc($_POST["year"]);
if (!
$year)
    
bark("Jums jāievada gads!");
$descr unesc($_POST["descr"]);
if (!
$descr)
    
bark("Jums jāievada apraksts!");
$imdb unesc($_POST["imdb"]);
if (!
$imdb)
    
bark("Jums jāievada IMDB adrese!");
$url unesc($_POST["url"]);
if (!
$imdb)
    
bark("Jums jāievada YouTube trailera adrese!");


$fposter htmlspecialchars($poster);
$fname htmlspecialchars($name);
$foriname htmlspecialchars($oriname);
$fyear htmlspecialchars($year);
$fgenre htmlspecialchars($genre);
$owner = (int)$CURUSER['id'];
    
$upload mysql_query('INSERT INTO premieres (name, poster, genre, year, descr, imdb, owner, ori_name, url) VALUES ('.implode(', 'array_map('sqlesc', array($fname$fposter$fgenre$fyear$descr$imdb$owner$foriname$url))).')') or sqlerr(__FILE__,__LINE__);
if(
$upload == 'true'){
if(
$use_bonus == '1'){
sql_query("UPDATE users SET bonus = bonus + $nr WHERE id = ".$CURUSER["id"]."");
}
header("Refresh: 2; url=/filmas.php");
stderr("Veiksmīgi "," Jūs esat veiksmīgi pievienojis filmu!");
}else{
header("Refresh: 2; url=/filmas.php");
stderr("Kļūda""Neizdevās pievienot filmu!");
}    
}
else
    
stderr("Kļūda!");

die;

?>
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #7  
Old 24th May 2012, 13:04
mat22 mat22 is offline
Senior Member
 
Join Date: Jun 2009
Latvia
Posts: 119
Default
Thank you! It works perfectly now!

Maybe you have some design ideas too for this thing? It looks kinda crappy atm.
Reply With Quote
  #8  
Old 24th May 2012, 13:07
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
Quote:
Originally Posted by mat22 View Post
Thank you! It works perfectly now!

Maybe you have some design ideas too for this thing? It looks kinda crappy atm.
I don't do design work I do make it work
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #9  
Old 24th May 2012, 13:52
mat22 mat22 is offline
Senior Member
 
Join Date: Jun 2009
Latvia
Posts: 119
Default
Quote:
Originally Posted by joeroberts View Post
I don't do design work I do make it work
Ok. Anyway - thank you for fixing this thing.
Reply With Quote
  #10  
Old 24th May 2012, 14:18
BitFarmer's Avatar
BitFarmer BitFarmer is offline
Senior Member
 
Join Date: Jan 2012
Latvia
Posts: 99
Default
hey nice to see someone from lv makeing a new tracker
Reply With Quote
Reply

Tags
edit , info , movies , premiere

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 09:51. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.