You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!

Author Search Results: '64'

We found 3,871 matches.


<< < > >>

Viewing 31-60 of 3,871 matches. 1 | 2 | 3 | 4 | 5 | 6 | 768130

31.

None

Topic: Mysql - Listing One Row Per Key

Posted: 07/26/08 05:31 PM

Forum: Programming

I don't have a topic table and a post table, I just have one table with all of the posts.

I like the idea of SELECT * FROM `bbs` GROUP BY `topic_id`, except it doesn't seem to want to order properly.

I tried SELECT * FROM `bbs` GROUP BY `topic_id` ORDER BY `time` but I don't think it's ordering it by the greatest value of the fields in the group.


32.

Elated

Topic: Mysql - Listing One Row Per Key

Posted: 07/26/08 05:15 PM

Forum: Programming

Actually, I think I just came up a way to make it work.

I set a blank array before anything, then I loaded every post into a MySQL fetch array ordered by date. In the while loop to load all the post rows, I used an if array_key_exists function to check if I had specified the topic id in my blank array from before. If it's not there, it echos the subject and inserts the topic_id as a key in the array.

Ees brilliant!


33.

None

Topic: Mysql - Listing One Row Per Key

Posted: 07/26/08 04:42 PM

Forum: Programming

Nah, I know how to do that. I need some way to find one row from a group of rows based on a unique identifier. The table holds all the posts made to the forums.

You've got the body, subject, timestamp, post id and topic id. For the topic list, I need to have it load only one post row from the group of rows that share the same topic id, so there is only one topic link regardless of rows with said topic id.


34.

Expressionless

Topic: Mysql - Listing One Row Per Key

Posted: 07/26/08 04:23 PM

Forum: Programming

Okay, quick question. I have a table with all kinds of data in it, they all have a body message and a topic_id, that being the name of the field. I need a way to call only one row for each one that has the same topic_id value.

For example, I have five rows, each with topic_id values 1, 1, 2, 1, 3 respectively. I want to echo back only three results, because there are only three rows with unique topic_id values. I'm making a forum, and I'm trying to figure out the topic lists, if it matters.

I'm not really sure how I would go about doing this, does anyone know? Also, as if it couldn't get more confusing, it needs to order them descending from the highest date value in the table (another field name). Basically, so more recently updated topics are bumped to the beginning of the list.


35.

Elated

Topic: Mysql Forum Issues

Posted: 07/20/08 02:56 AM

Forum: Programming

Wow, I can't believe I never learned this before! Thanks a million.


36.

Sad

Topic: Mysql Forum Issues

Posted: 07/20/08 01:52 AM

Forum: Programming

I'm building a rather large site, a main component of which is the forums. Rather than bulking it down with a phpBB system, I decided to go at it a little more authentically by building my own forums from scratch.

Everything was going fine, but I bumped into a major glitch. Here's an example of the code I'm trying to get to work, minus the fancy formatting and everything.

<?php
while ($topic_rows = mysql_fetch_array($topic_query)){
while ($poster_rows = mysql_fetch_array($poster_query)){

if($topic_rows['topic_id']==$id){
if($topic_rows['poster_id']==$poster_rows['user_id']){

echo("<font size=\"+1\">".$poster_rows['fname']."</font><br/>");

}
}
}
}
?>

What the code is supposed to do is make a simple list from top to bottom of the first names of the posters in the theoretical topic. I'm trying to load all of the posts in the database granted the id specified in the URL is the same as the id listed in whatever MySQL row it loads up.

At the same time it needs to find the user id of the post and match it with the user id in the users table in the same database, so that it can load the poster's name and other information.

This is the only way I can think of to go about this, but it seems to only work half-way, and I'm not sure why. I think it should work if it were to load everything in the post table, THEN load everything in the users table and match it all up, but I'm not sure if it's doing that. Some names show up, then all of a sudden the second name that should show up doesn't even get caught in the while loop.


37.

None

Topic: Simple Javascript Question

Posted: 07/17/08 03:48 PM

Forum: Programming

Way to think outside the box! Thanks guys, you've been loads of help.


38.

Sleeping

Topic: Simple Javascript Question

Posted: 07/17/08 02:00 PM

Forum: Programming

Yeah, I'm not very good at explaining, sorry.

When the Ajax function is called, it loads the PHP file and does all the fancy stuff in there. The, when the request is done:

if(ajaxRequest.readyState == 4){
document.getElementById('time').innerHTML=ajaxRequest.responseText;
}

Whatever is echoed in the PHP file is what ajaxRequest.responseText becomes. So let's say it loads the PHP file, in which the code is:

<?php
echo("Request completed.");
?>

It will change the content of the time div to say Request completed.

This means that the only thing it can grab back from the PHP is what is echoed, but that limits me to just one value. I can use innerHTML to change, for instance, the number of votes by loading the value from the SQL database in the PHP file. But I can't do that and get the current score and set that somewhere else in the HTML file, because the Ajax works by taking the echoed text in the PHP file, which can only be one thing.

Please tell me if I'm making any sense.


39.

None

Topic: Simple Javascript Question

Posted: 07/17/08 12:30 PM

Forum: Programming

Sweet, that's exactly what I was looking for.

Does anyone know how to pull separate values from an Ajax-requested PHP file?


40.

Shouting

Topic: Simple Javascript Question

Posted: 07/17/08 05:19 AM

Forum: Programming

I'm trying to learn Ajax when I realize that I don't know Javascript, which seems kinda important. So now I'm learning Javascript.

I found a tutorial how to send an Ajax request to a PHP file, which seems to work perfectly. I'm going to be making a voting system with this. Basically you'll click whatever score you want and it will send the request to the PHP file, going into the MySQL database and doing all the necessary things in there.

I'm stuck at this part, because I want it to restrict voting again by replacing the score links with some kind of text, update the score and number of votes all without having to reload the entire page. I think I have it all planned out, I just have two questions about Javascript first.

Is there a way to change some printed text on the screen through a function? I know you can do it with forms, like change the text inside an input box, but I'm not sure how to change a certain bit of basic printed text when a function is called. For all I know it could be easier than doing it inside a form box, I don't know.

Secondly, when my Ajax request is sent:

ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
document.formname.inputbox.value="You voted "+ajaxRequest.responseText+".";
}
}

All I had to do was echo on the PHP page what I wanted ajaxRequest.responseText to be on the main page, if that makes any sense. That works fine for just one string, but what if I wanted to load different values in the PHP page and transfer them as different variables into the main page when the Ajax request was completed?


41.

Resigned

Topic: MySql Root Lingo

Posted: 07/15/08 06:12 PM

Forum: Programming

Well yeah, but you see what I mean. If you actually fuck up and send yourself to the 404 it will change the URL to the error page.

'Tis no bueno.


42.

None

Topic: MySql Root Lingo

Posted: 07/15/08 02:45 AM

Forum: Programming

At 7/15/08 02:32 AM, ZiggyZack99 wrote: Beer'll do that to yeh.

Yeah I just got back from space and everything.. yeah just a little bit off tonight.

So, anyone, about my problem?


43.

None

Topic: MySql Root Lingo

Posted: 07/15/08 01:01 AM

Forum: Programming

Oh fuck, I meant .htaccess, not MySql.

Sorreh.


44.

Sad

Topic: MySql Root Lingo

Posted: 07/14/08 09:11 PM

Forum: Programming

I'm trying to set my custom 404 to a certain page, but I've run into a dilemma.

On one hand, if I type

ErrorDocument 404 /error.php?error=404

It works fine and maintains the attempted URL in the address bar. However, if somebody mistypes a directory like http://www.site.com/xdfsadf/asdfasdf/asf dasdf/asfd, then it will try to find error.php in the directory you typed and fuck up the CSS and links.

On the other, if I type

ErrorDocument 404 http://www.site.com/error.php?error=404

Note the full URL in the .htaccess, meaning it will have no choice to go to that one file in the root directory. Unfortunately, it changes the address bar URL to the 404 page, and I don't like that.

Is there any way to fix this? I know Newgrounds works, so what do they do? I'm new to this shit.


45.

None

Topic: Wtb "page System" With Php / Sql

Posted: 07/14/08 09:02 PM

Forum: Programming

At 7/14/08 05:01 PM, Anim8or666 wrote: What do you need forums for? Didn't you say the forums on 64 media were gone for good? Or is this for another project? However, I do commend you for making your own forum system.

Yeah these forums are for Indie Cave.


46.

Elated

Topic: Wtb "page System" With Php / Sql

Posted: 07/14/08 04:33 PM

Forum: Programming

Thank you sir! I changed around some of your stuff and it works like a charm.


47.

Expressionless

Topic: Wtb "page System" With Php / Sql

Posted: 07/14/08 03:40 PM

Forum: Programming

I've never had to do this before, so I'm not quite familiar with it. BUT! I'm making my own BBS and I need to make a page system so you don't have 200 posts on one thread running down the browser window. I've halfway go it. Depending on the $page variable, it will spit out the number to start loading and the number to end, if that makes any sense.

I'm using my 64 Upload file table as a test for this:

$min=(($page-1)*30)+1;
$max=$page*30;

$i=$min;

while ($files_rows = mysql_fetch_array($sites_query)){
if($i<=$max){
$file=$files_rows['file'];
echo($file."<div style=\"height:10px\"></div>");
$i++;
}
}

What I don't know how to do is start the array fetching at $i rather than always at 1, or 0, or whatever it is.


48.

Elated

Topic: Javascript Form Question

Posted: 07/07/08 02:30 PM

Forum: Programming

Wow my thread kinda derailed there for a second. I got it working after the second reply or so, but I'll post the code I used if anyone wants to use it.

Javascript:

<script language="JavaScript" type="text/javascript">

function sevent() {
var dd = document.register.country_register.selectedIndex;
var txt = document.register.country_register[dd].text;
if(txt == 'United States'){
document.register.state_register.disabled = '';
} else {
document.register.state_register.disabled = 'disabled';
}
}

</script>

I'll explain the code for anyone who knows no Javascript, like me.

var dd = document.register.country_register.selec tedIndex;
When the function is called, this sets a variable dd to the number of the selected element.

var txt = document.register.country_register[dd].t ext;
This then sets a variable txt to the actual text value of the selected element.

if(txt == 'United States'){
If, when the function is called, the selected element is anything United States...

document.register.state_register.disable d = '';
...enable the state select box.

} else { document.register.state_register.disable d = 'disabled';
Otherwise, disable the box.

You just need to call the function sevent() when the element changes in the country box. Here's the HTML code:

<select name="country_register" onchange="sevent()">
<!-- Country options here -->
</select>

Hope this helps out!


49.

None

Topic: Javascript Submit Button

Posted: 07/07/08 12:23 AM

Forum: Programming

How would that work with PHP's if(isset($_POST['submit_button'])) thing?


50.

None

Topic: Javascript Submit Button

Posted: 07/06/08 11:18 PM

Forum: Programming

There seems to be a problem with my script. It seemingly works fine, except when I try to relay back information via PHP, it doesn't seem to pick anything up from the form.


51.

None

Topic: Javascript Form Question

Posted: 07/06/08 09:59 PM

Forum: Programming

Okay, another question. Is it possible to disable a selection box if the value of another selection box is something?

Let's say you have a country list. If United States is selected, it will enable the States box next to it, but anything other than United States will disable the states box.


52.

Elated

Topic: Javascript Submit Button

Posted: 07/06/08 05:37 PM

Forum: Programming

Yeah, sure. Here's an example code:

<input type="submit" value="Submit" />

There's your normal submit button. Add onclick="this.disabled=true; this.form.submit();" to the input tag. Final code:

<input type="submit" value="Submit" onclick="this.disabled=true; this.form.submit();"/>

Works like a charm!


53.

Expressionless

Topic: Javascript Submit Button

Posted: 07/06/08 05:15 PM

Forum: Programming

Disregard that, I suck cocks.

Found one.


54.

None

Topic: Javascript Submit Button

Posted: 07/06/08 05:11 PM

Forum: Programming

I know a few web languages, but no Javascript whatsoever. I plan to learn, but I need a script to set a form to disable the submit button as soon as it's clicked. Not after it's done submitting, because that defeats the purpose. Especially when it deals with uploading a file.

I've looked around Google and can't find exactly what I'm looking for. I don't need any pop-ups for anything fancy, just a disabled button on click.


55.

None

Topic: Php Cookie Question

Posted: 07/06/08 05:04 PM

Forum: Programming

Well for example, every time you login it would setcookie("login_data",$_POST['username'
]);
. Then use the if(isset($_COOKIE["login_data"])) and the value to do all of the fancy user things.

It seems to reset the cookie back to nothing after the browser is closed. How would I prevent that?


56.

None

Topic: Php Cookie Question

Posted: 07/06/08 03:32 PM

Forum: Programming

I'm working on a site that would involve user accounts with cookies, but I have a bit of a problem. I don't think I'm doing it right. Every time you exit the browser and reload the site, it doesn't log you back in.


57.

None

Topic: Browser Compatibility Issue

Posted: 07/02/08 08:09 PM

Forum: Programming

At 7/2/08 08:04 PM, elbekko wrote: Margins. Also, inline CSS? :/

I only know the bare basics of CSS. PHP is really more my specialty, being left-brained and all. What would I do to fix it? I set everything inside an 800px container, but it still spills out of it.


58.

Shouting

Topic: Browser Compatibility Issue

Posted: 07/02/08 07:54 PM

Forum: Programming

I've got a navigation bar that I've set at a width of 800px. Which seems to be the opposite of the norm, it actually works fine in Internet Explorer, but in Firefox it's an extra 20px wider on each side.

Here's the page: http://www.indiecave.com/index.php.

HTML:

<ul style="width:800px" id="nav">
<ul style="width:800px; height:30px">
<?php
include("nav.php");
?>
</ul>
</ul>

CSS:

#nav {
margin:auto;
width:800px;
height:30px;
background-image:url(image/template/navbg.gif);
background-repeat:repeat-x;
display: block;
overflow: hidden;
list-style: none;
color:#FFFFFF;
}

#nav li {
display: inline;
}

#nav li a {
display: block;
float: left;
padding:7px 20px;
color:#FFFFFF;
text-decoration: none;
}

#nav li a:hover {
background-image:url(image/template/navhover.gif);
background-repeat:repeat-x;
}

#navin {
background-image:url(image/template/navin.gif);
background-repeat:repeat-x;
display: block;
float: left;
padding:7px 20px;
color:#000000;
text-decoration: none;
}


59.

None

Topic: Sideways Scroll Text

Posted: 06/27/08 10:13 PM

Forum: Flash

At 6/25/08 01:42 AM, Hk3 wrote: Offtopic sorry:
64 I know what font that is on your homepage :0
Birth of a Hero?

Yeah it is. :P

I filled in some of the grungy gaps to make it a bit more conventional, though. It reminded me of the Rock Band font, so I got it.


60.

Elated

Topic: Sideways Scroll Text

Posted: 06/24/08 09:55 PM

Forum: Flash

At 6/23/08 11:15 AM, knugen wrote: I have wondered about how to adjust the size of dynamic text boxes depending on the content for a while myself, but now I made little bit of research and it seems that the solution is as simple as the autoSize property :)

Brilliant! I was able to use that to adjust the size of the text box like you said, giving me enough to find the overshot width, and thus enough space it needs to scroll. Thank you sir.

Here is a small preview of the result: http://www.64upload.com/?flash=252_Playl ist.swf. Nothing is being loaded from the database yet, but roll over the third selection to see the scrolling in action!


All times are Eastern Standard Time (GMT -5) | Current Time: 02:25 PM

<< < > >>

Viewing 31-60 of 3,871 matches. 1 | 2 | 3 | 4 | 5 | 6 | 768130