Jump to content

Twister1004

Members
  • Posts

    201
  • Joined

  • Last visited

Posts posted by Twister1004

  1. Hey everyone! I have a simple yet complicated problem. lol.

     

    I'm making a comment page on the same as a profile page. However, I don't know Javascript, so that means it's a little more difficult.

     

    Objective: I want to make the comment box in a scrolling box, not write able (Unless PHP is entered).

     

    I have tried to use a textarea, however it will displays the <br/>. 

    I have tried frameset.

     

     

    Any other ideas are accepted =)

  2. Ahh, I see your point wise one! I also see why I seemed for it to not work right. The SQL was partly messed up from where I altered it.

     

    Although, I didn't think I could reset the pointer until your last post sparked my idea to reset it to 0.

     

    Thank you very much uniflare. <3.

     

    Fixed script.

     

    $gettickets = mysql_query("SELECT * FROM `cype_tickets` WHERE `name` = '{$_SESSION['pname']}' AND `status` = 'Open' ORDER BY `ticketid` DESC")or die(mysql_error());
    		$getnumber = mysql_num_rows($gettickets);
    		$NumberTicket = 0;
    		while($tickets = mysql_fetch_array($gettickets)){
    			echo "
    				<tr>
    					<th>
    						" . ++$NumberTicket . "
    					</th>
    					<td>
    						<a href =\"?cype=ucp&page=ticket&a=$tickets[ticketid]&ticket=Yes\">
    							" . $tickets['title'] . "
    						</a>
    					</td>
    					<td>
    						" . $tickets['date'] . "
    					</td>
    					<th>
    						" . $tickets['status'] . "
    					</th>
    				</tr>
    			";
    		}
    	echo "
    	</table>";
    	//Check to see if the user has more than five tickets open.
    	$pointerReset = mysql_data_seek($gettickets, 0);
    	$opentick = mysql_fetch_array($gettickets);
    	if($getnumber >= 5 && $opentick['status'] == "Open"){
    		echo "<b><center>Please wait until one of your tickets is solved before creating another one.</center></b>";
    	} else{
    	echo "
    		<center>
    			<input type=\"button\" value=\"Create Ticket\" onclick='parent.window.location = \"?cype=ucp&page=ticket&ticket=create\"' />
    		</center>
    		";
    	}
    

     

  3. Hey everyone! How are you doing? Well, I'm glad you ok, or doing ok. But I have an Issue I would like to ask of your help.

     

     

    Objective: Figure out why this script isn't executing correctly.

     

    Problem: Well, like earlier, I'm making a ticketing system, but I can't seem where I went wrong.

     

    Issue: It will show the previous tickets EXCEPT the last ticket created by the user.

     

    PHP Partial with the problem.

    $gettickets = mysql_query("SELECT * FROM `cype_tickets` WHERE `name` = '{$_SESSION['pname']}' ORDER BY `ticketid` DESC")or die(mysql_error());
    		$getnumber = mysql_num_rows($gettickets);
    		$opentick = mysql_fetch_array($gettickets);
    		$NumberTicket = 0;
    		while($tickets = mysql_fetch_array($gettickets)){
    			echo "
    				<tr>
    					<th>
    						" . ++$NumberTicket . "
    					</th>
    					<td>
    						<a href =\"?cype=ucp&page=ticket&a=$tickets[ticketid]&ticket=Yes\">
    							" . $tickets['title'] . "
    						</a>
    					</td>
    					<td>
    						" . $tickets['date'] . "
    					</td>
    					<th>
    						" . $tickets['status'] . "
    					</th>
    				</tr>
    			";
    		}
    	echo "
    	</table>";
    	//Check to see if the user has more than five tickets open.
    	if($getnumber >= 5 && $opentick['status'] == "Open"){
    		echo "<b><center>Please wait until one of your tickets is solved before creating another one.</center></b>";
    	} else{
    	echo "
    		<center>
    			<input type=\"button\" value=\"Create Ticket\" onclick='parent.window.location = \"?cype=ucp&page=ticket&ticket=create\"' />
    		</center>
    		";
    	}
    

     

    I've been on this for about 1 hour and I've not figure it out, with multiple testing. It is more than likely a stupid mistake, but I can't seem to find it.

     

     

    Thank you for your help and for reading this.

  4. Hey everyone! How are you all doing? Well, I'm back again with another issue I can't seem to logicaly figure out (Probably thinking too hard).

     

    Objective: I'm making a ticket system for a group I'm with, and what I want to do is kinda tricky. Well to me anyways.

     

    Issue: I can't seem to logically think out how to increase the ticket number available by the user's name. Meaning, a person can only have a max number of 5 tickets. So I am trying to figure out in a function how to check for a user's name and increase its value.

     

    File I've made. (Note: It's not the whole file. This is the part of the file that is only affecting this.)

    $_SESSION['pname'] = "Twister";
    function ticketNumber(){
    $countID = 0;
    $countTickets = mysql_query("SELECT COUNT(*) FROM `cype_tickets` WHERE `name` = 'Twister'");
    while($countTicks = mysql_fetch_array($countTickets)){
    	++$countID;
    	return $countID;
    }
    }
    echo ticketNumber();
    $gettickets = mysql_query("SELECT * FROM `cype_tickets` WHERE `name` = '{$_SESSION['pname']}' ORDER BY `ticketid` DESC LIMIT 6")or die(mysql_error());
    		$getnumber = mysql_num_rows($gettickets);
    		$opentick = mysql_fetch_array($gettickets);
    		while($tickets = mysql_fetch_array($gettickets)){
    			echo "
    			<table border=\"1\">
    				<tr>
    					<th>
    						" . $tickets['ticketid'] . "
    					</th>
    					<td>
    						<a href =\"?cype=main&page=ticket&a=$tickets[ticketid]&v=yes\">
    							" . $tickets['title'] . "
    						</a>
    					</td>
    					<td>
    						" . $tickets['date'] . "
    					</td>
    					<th>
    						" . $tickets['status'] . "
    					</th>
    				</tr>
    			";
    		}
    	echo "
    	</table>";
    	if($getnumber >= 5 && $opentick['status'] == "Open"){
    		echo "<b><center>Please wait until one of your tickets is solved before creating another one.</center></b>";
    	} else{
    	echo "
    		<center>
    			<input type=\"button\" value=\"Create Ticket\" onclick='parent.window.location = \"?cype=ucp&page=ticket&ticket=create\"' />
    		</center>
    		";
    	}
    

     

    Thank you for your help.

  5. ok,

     

    Well, I just wrote a few codes, but they doesn't wanna work.

     

    Any ideas what I did wrongly? xD

     

    str_replace(array("[b]", "[/b]"), array("<b>", "</b>"), $c['comment']);
    str_replace(array("[i]", "[/i]"), array("<i>", "</i>"), $c['comment']);
    str_replace(array("[u]", "[/u]"), array("<u>", "</u>"), $c['comment']);
    str_replace(array("
    [center]", "[/center]
    "), array("<center>", "</center>"), $c['comment']);
    str_replace(array("
    [right]", "[/right]
    "), array("<span align=\"right\">", "</span>"), $c['comment']);
    str_replace(array("
    [left]", "[/left]
    "), array("<span align=\"left\">", "</span>"), $c['comment']);
    str_replace(array("[img=http://", "]"), array("<img src = \" \">", "</img>"), $c['comment']);
    str_replace(array("[url=http://", "]", "[/url]"), array("<a href=\"\">","</a>"), $c['comment']);
    str_replace(array("[color]", "[/color]"), array("<font color=\"\">", "</font>"), $c['comment']);
    str_replace(array("[font]", "[/font]"), array("<font face=\"\">", "</font>"), $c['comment']);
    

     

     

  6. OMG CORBIN I LOVE YOU!!! <3

     

    *IS EXCITED~!*

     

    I actually get it now =D!!!!

     

    str_replace("hey!", "Go die!", "Hey! Tyler!");

     

    So let me get this clear and make sure!

     

    1st parameter ("hey!") Is what it is looking for.

    2nd parameter ("Go Die!") is what it will replace once it finds the "hey!".

    3rd parameter ("Hey! Tyler!") is the input and will look in this parameter and look for the "hey!" and then it will replace it?

     

     

    Final Clear up, This is my final answer for $50,000!!! IS IT CORRECT?! *Waits for the answer!*

  7. No offense taken Corbin. I'm not easily offended when I'm trying to learn something new.

     

    So, by how this is setup (Really confuzzling to me, but still learning its structor), there is a loop going on, and it is named $c.

     

    So to do what your saying I need to do, but I think I get it, please correct me if I'm wrong,

     

    $code = str_replace("[-b]", "<b>", "bold");

     

    The first one would be if it finds it ([-b]) then it will replace it with <b>. Then the "bold" is its name?

  8. Hey everyone! I have another question, still with my PHP skills still in development =)

     

    Objective:

    I am trying to make a BBCode for a webpage so it will just register it when it sees it. More like Using a Smiley and not the "=P" stuff. This is not for forums. This is for like a little comments on a users profile.

     

    Issue:

    I don't know exactly how to go about this. I was told I was doing it wrong, which now I believe I am, however, I don't know of another way. Either I'm too stupid or I've just never used it. (I've not done anything like this!!!!!)

     

    So without further due, here is the original code I wrote,

    <?php
    error_reporting(E_ALL);
    if("[b]" || "[b]"){
    echo "<b>";
    } elseif("[/b]" || "[/b]"){
    echo "</b>";
    } elseif("[i]" || "[i]"){
    echo "<i>";
    } elseif("[/i]" || "[/i]"){
    echo "</i>";
    } elseif("[u]" || "[u]"){
    echo "<u>";
    } elseif("[/u]" || "[/u]"){
    echo "</u>";
    } elseif("
    [center]"){
    echo "<center>";
    } elseif("[/center]
    "){
    echo "</center>";
    } elseif("
    [right]"){
    echo "<span align=\"right\">";
    } elseif("[/right]
    "){
    echo "</span>";
    } elseif("
    [left]"){
    echo "<span align=\"left\">";
    } elseif("[/left]
    "){
    echo "</span>";
    } elseif("[img]http://"){
    echo "<img src=\"";
    } elseif("[/img]"){
    echo "\" alt=\"Image\"";
    } elseif("[url=http://"){
    echo "<a href=\"$\">";
    } elseif("]"){
    echo "<a href=\"$\">";
    } elseif("[/url]"){
    echo "</a>";
    } elseif("[font]"){
    echo "<font face=\"";
    } elseif("[/font]"){
    echo "\"</font>";
    } elseif("[color]"){
    echo "<font color=\"";
    } elseif("[/color]"){
    echo "\"</font>";
    } elseif("" || "=)"){
    echo "<img src=\"parser/smileys/smile.gif\" alt=\"sad\"";
    } elseif("" || "=P"){
    echo "<img src=\"parser/smileys/tounge.gif\" alt=\"sad\"";
    } elseif(":/" || "=/"){
    echo "<img src=\"parser/smileys/bored.gif\" alt=\"sad\"";
    } elseif(""){
    echo "<img src=\"parser/smileys/lol.gif\" alt=\"sad\"";
    } elseif("" || ">=("){
    echo "<img src=\"parser/smileys/mad.gif\" alt=\"sad\"";
    } elseif("" || "=O"){
    echo "<img src=\"parser/smileys/smile.gif\" alt=\"sad\"";
    } elseif("" || "=("){
    echo "<img src=\"parser/smileys/sad.gif\" alt=\"sad\"";
    } elseif(":wink:" || "^_~" || "" || ""){
    echo "<img src=\"parser/smileys/wink.gif\" alt=\"wink\"";
    }
    ?>
    

     

     

    Any help would be greatly appreciated!

×
×
  • 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.