Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Yuna Scatari Edition (YSE) (http://www.bvlist.com/forumdisplay.php?f=22)
-   -   Premiere movies - can't edit info (http://www.bvlist.com/showthread.php?t=7961)

mat22 22nd May 2012 15:16

Premiere movies - can't edit info
 
3 Attachment(s)
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.

joeroberts 22nd May 2012 15:31

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.

mat22 23rd May 2012 12:20

1 Attachment(s)
Quote:

Originally Posted by joeroberts (Post 34905)
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.:-|

joeroberts 23rd May 2012 16:35

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\"><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\"><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\"><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\"><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\"><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();
?>


mat22 23rd May 2012 19:25

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?

joeroberts 24th May 2012 06:20

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;

?>


mat22 24th May 2012 13:04

Thank you! It works perfectly now!

Maybe you have some design ideas too for this thing? It looks kinda crappy atm.

joeroberts 24th May 2012 13:07

Quote:

Originally Posted by mat22 (Post 34948)
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 :ok:

mat22 24th May 2012 13:52

Quote:

Originally Posted by joeroberts (Post 34949)
I don't do design work I do make it work :ok:

Ok. Anyway - thank you for fixing this thing.

BitFarmer 24th May 2012 14:18

hey nice to see someone from lv makeing a new tracker :ok:


All times are GMT +2. The time now is 16:32.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.