Jump to content

mischievousx3

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mischievousx3's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm having a problem with adding icon/avatar to my database..this is a submit form where I just submit the avatar url. I don't know how to change the submit link from avatar_add.php?mode=submit to index.php?mode=submit&x=avatar_add. http://www.graphics.allmerk-noplay.com/index.php?x=avatar_add <?php $host =""; // host name $user =""; // user $pass =""; // password $dbase =""; // database name // connect to the server mysql_connect("$host","$user","$pass"); // and select the database mysql_select_db($dbase); $mode=$_GET["mode"]; // get the mode $QUERY_STRING = 'x=avatar_add'; if(!isset($mode) || empty($mode)) // if mode is empty, switch to case index { $mode='index'; } switch($mode) { case 'index'; // displays the form ?> <form method="post" action="avatar_add.php?mode=submit"> Avatar URL:<br> <input type="text" name="avatar_url" size="30"><br><br> <input type="submit" value="Submit"> <?php break; case 'submit'; // form processing mode $avatar_url=$_POST["avatar_url"]; // check for empty fields if(empty($avatar_url)) { echo "Error! Please go back and fill in all the required fields!"; // if you have a footer include, insert it before the die statement die; // stops the script from executing the rest of the code } // let's get the date in YYYY-MM-DD format $date = date("Y-m-d"); $query="INSERT into icons_db (id,avatar_url) VALUES ('','$avatar_url')"; $result=mysql_query($query) or die ("Couldnot execute query: $query." . mysql_error()); if($result) // if mysql query successful { echo "Thank you! The avatar has been added to or database."; } break; } ?>
  2. Hello. I'm using the new version of cutenews (1.4.6). My first issue was that the comments link doesn't work..it redirects me to my homepage, same thing happens to the read more link. i decided to add "$PHP_SELF = 'files/news.php';" on my show_news.php . it takes me to that full story/comment form, however my layout is gone..it's like my index.php isn't included anymore. http://www.allmerk-noplay.com/index.php?x=news <-full story page http://www.allmerk-noplay.com/index.php - at the bottom , read more link (excuse the mess) I am using php dynamic links and here is my code: <?php // THIS WAS EXPLAINED IN PHP Includes // GETS VALUE FOR $page $page = strip_tags($_GET['x']); // SEES IF $page IS DEFINED // IF IT ISN'T IT WILL DISPLAY home.txt if (!$page) { $include = 'files/main.php'; include ($include); } else { // $include ADDS THE DIRECTORY AND PAGE EXTENSION OF page $include = 'files/'.$page.'.php'; // CHECKS IF $include EXISTS if (is_file("$include")) { // SHOWS THE CONTENT OF $include include ($include); } // DISPLAY ERROR MESSAGE IF $include IS NOT FOUND else { echo "The page you were trying to access is not found on this server."; } } // THIS WAS EXPLAINED IN PHP Includes ?> this is where my news show up: <div class="news"> <?PHP $number=3; $PHP_SELF = 'files/news.php'; include("/home/allmerknoplay/AllMerk-NoPlay.com/cutenews/show_news.php"); ?> </div> and this is my show_news page: <?PHP error_reporting (E_ALL ^ E_NOTICE); $cutepath = __FILE__; $cutepath = preg_replace( "'\\\show_news\.php'", "", $cutepath); $cutepath = preg_replace( "'/show_news\.php'", "", $cutepath); require_once("$cutepath/inc/functions.inc.php"); require_once("$cutepath/data/config.php"); // If we are showing RSS, include some need variables. if($template == 'rss'){ include("$cutepath/data/rss_config.php"); } //---------------------------------- // Check if we are included by PATH //---------------------------------- if($_SERVER["HTTP_ACCEPT"] or $_SERVER["HTTP_ACCEPT_CHARSET"] or $_SERVER["HTTP_ACCEPT_ENCODING"] or $_SERVER["HTTP_CONNECTION"]){ /* do nothing */ } elseif(eregi("show_news.php", $PHP_SELF)){ die("<h4>CuteNews has detected that you are including show_news.php using the URL to this file.<br> This is incorrect and you must include it using the PATH to show_news.php</h4><br>Example:<br> this is <font color=red>WRONG</font> : <?PHP include(\"http://yoursite.com/cutenews/show_news.php\"); ?><br> this is <font color=green>CORRECT</font>: <?PHP include(\"cutenews/show_news.php\"); ?><br> <br><BR>// <font size=2>if you think this message shouldn't be shown, open show_news.php and delete it from there</font>"); } //---------------------------------- // End of the check //---------------------------------- if(!isset($subaction) or $subaction == ""){ $subaction = $POST["subaction"]; } if(!isset($template) or $template == "" or strtolower($template) == "default"){ require_once("$cutepath/data/Default.tpl"); } else{ if(file_exists("$cutepath/data/${template}.tpl")){ require("$cutepath/data/${template}.tpl"); } else{ die("Error!<br>the template <b>".htmlspecialchars($template)."</b> does not exists, note that templates are case sensetive and you must write the name exactly as it is"); } } // Prepare requested categories if(eregi("[a-z]", $category)){ die("<b>Error</b>!<br>CuteNews has detected that you use \$category = \"".htmlspecialchars($category)."\"; but you can call the categories only with their <b>ID</b> numbers and not with names<br> example:<br><blockquote><?PHP<br>\$category = \"1\";<br>include(\"path/to/show_news.php\");<br>?></blockquote>"); } $category = preg_replace("/ /", "", $category); $tmp_cats_arr = explode(",", $category); foreach($tmp_cats_arr as $key=>$value){ if($value != ""){ $requested_cats[$value] = TRUE; } } if($archive == ""){ $news_file = "$cutepath/data/news.txt"; $comm_file = "$cutepath/data/comments.txt"; }else{ $news_file = "$cutepath/data/archives/$archive.news.arch"; $comm_file = "$cutepath/data/archives/$archive.comments.arch"; } $allow_add_comment = FALSE; $allow_full_story = FALSE; $allow_active_news = FALSE; $allow_comments = FALSE; //<<<------------ Detarime what user want to do if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment") and ((!isset($category) or $category == "") or ($requested_cats[$ucat] == TRUE ) ) ){ if($subaction == "addcomment"){ $allow_add_comment = TRUE; $allow_comments = TRUE; } if($subaction == "showcomments"){ $allow_comments = TRUE; } if(($subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes"){$allow_full_story = TRUE; } if($subaction == "showfull") $allow_full_story = TRUE; if($subaction == "showfull" and $config_show_comments_with_full == "yes") $allow_comments = TRUE; } else{ if($config_reverse_active == "yes"){ $reverse = TRUE; } $allow_active_news = TRUE; } //----------->>> Detarime what user want to do require("$cutepath/inc/shows.inc.php"); if($_GET['archive'] and $_GET['archive'] != ''){ $archive = $_GET['archive']; } // stupid fix ? unset($static, $template, $requested_cats, $category, $catid, $cat,$reverse, $in_use, $archives_arr, $number, $no_prev, $no_next, $i, $showed, $prev, $used_archives); // Untamed Edit //<!-- News Powered by CuteNews: http://cutephp.com/ --> // End Edit ?> this is frustrating because on my other website where i'm using cutenews, the comment links works..any help would be greatlyappreciated. thanks.
  3. I'm having problems with one of my links http://www.allmerk-noplay.com/index.php?x=live i have a live stream embedded on that page as well as a chat that comes with it. here is the code: <div class="live"> <object type="application/x-shockwave-flash" height="400" width="450" id="jtv_flash" data="http://www.justin.tv/widgets/live_embed_player.swf?start_volume=0.5&backgroundImage=&channel=gunmetal&hostname=www.justin.tv&auto_play=false" bgcolor="#000000"> <param name="allowFullScreen" value="true" /> <param name="allowScriptAccess" value="always" /> <param name="allowNetworking" value="all" /> <param name="movie" value="http://www.justin.tv/widgets/live_embed_player.swf" /> <param name="flashvars" value="start_volume=0.5&backgroundImage=&channel=gunmetal&hostname=www.justin.tv&auto_play=false" /> </object><br /> <a href="http://www.justin.tv/gunmetal#r=-rid-&s=em" style="padding:2px 0px 4px; display:block; width:353; font-weight:normal; font-size:10px; text-decoration:underline; text-align:center;">Watch live video from gunmetal on Justin.tv</a> <iframe frameborder="0" scrolling="no" id="chat_embed" src="http://www.justin.tv/chat/embed?channel=gunmetal&default_chat=jtv&popout_chat=true#r=-rid-&s=em" height="400" width="300"></iframe> </div> Everytime I go to that link, it automatically redirects me to the actual website of where the stream is. At first it was working perfectly fine, Id click on it and it stays on that page..the next day, the issue happened..I don't know what I did wrong between that time that made it go like that >.<
×
×
  • 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.