Jump to content

Renegade605

Members
  • Content Count

    120
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Renegade605

  • Rank
    Member
  • Birthday 05/15/1993

Previous Fields

  • Languages
    (X)HTML, CSS, JavaScript, PHP, (My)SQL

Contact Methods

  • Website URL
    http://www.theunitedfrontclan.com
  • ICQ
    0

Profile Information

  • Location
    Alberta, Canada
  1. So the command-line would parse the code and output it to another file, which I could then execute with the CoD4 server? How do I access the command-line?I'm running PHP 5.2.6 and I installed it as part of XAMPP 1.6.7
  2. I have recently decided that PHP would be the best way of achieving an effect with a Call of Duty 4 server I am running.I want to have my server run a random map and gametype rotation. What I need is for the server to call on (example) randommap.php and that php file would return the commands necessary to change the map.My question is, how do I get the php to actually run? When I try to call on randommap.php, the code is not parsed before being passed to the server. (Which causes an error, because "<?php" is not a command in CoD4.)
  3. Renegade605

    Mass Selectors?

    So I was wondering if there is a way to put CSS selectors in sort of a block format for readability and ease of typing. Example:Instead of: td.user span, td.user acronym, td.user div { background-color: green; } Use: td.user { span, acronym, div { background-color: green; } }
  4. Thanks for this, it works perfect. I figured JS might have this, I tried 'args', but the obvious one, well... I don't know about that... While someone experienced with code like you or I might find that easy, someone who's never used code before short of copy-paste (which probably 70% of the users will be) might find the syntax a little confusing and hard to use. (eg. forgetting a comma somewhere.)
  5. So I have a function where you pass it an array of strings, or arrays. Eg: func([ "string1", [ "string2-1", "string2-2", "string2-3" ], "string3" ]); The idea is, to make things easier on the end-user, they don't have to put every string within an array. If all 3 indices of the array are the same, they just specify a string and the function will convert it to an array where all 3 values are the same.The way I was doing it was this: ('ops' is the array arg that is passed to it) for (var i = 0; i < ops.length; i++){ if (ops[i][0].length > 1) { ops[i] = ops[i] || [ ]; } else { ops[i] = [ ops[i] ] || [ ]; }} This was made under the assumption that retrieving the index of a string just returned the character at that position.This presents two problems: If the user wants to specify an array where the 0 index is a string of length 1 (ie. "a"), the code will think it's a regular string and not an array, messing up the script. (This is the one I didn't see coming.) IE doesn't seem to behave the same way as FF when dealing with a string like an array. Instead of returning the character at pos 0, it returns 0, thus giving the error "0.length" is not a function. Therefore, it seems to me like I need a better way of detecting string versus array. I've tried comparing the original (ops) and the var with the .toString() method. Code: if (ops[i] == ops[i].toString()) { ops[i] = [ ops[i] ] || [ ]; }else { ops[i] = ops[i] || [ ]; } According to tests I ran in Firebug's console: "string".toString() = "string"[ "array_1", "array_2" ].toString() = "array_1,array_2" So I thought this would work. However, logging (ops == ops.toString()) always returned true, whether ops was a string or an array.So now I'm stumped, does anyone else have some insight into this?Thanks,
  6. I'm looking to create a function that will take anything from 3 to, hopefully, infinite arguments (in multiples of 3)I'm building a script that will take the data from a form and compile it all into a string. So I might specify as a string, and a function would search through that, and find |pf-...| and replace that with the value of a form field (the id of which is postform_text-yourname). So if you enter "1337 U53R" in that field, the result after compiling it would be .The problem is, building this strings that will be processed later can be confusing for users, and I want this script to be as userfriendly as possible. To that end, I want to build a function that users can call to add data to the string. Like so:postform_SetResult(condition,string,variable); Condition: Condition that must be true to add this, true if it always appears.String: A string to add, null if none.Variable: A variable that contains the ID of a form field, the value of which to be added to the string, null if none.So if the user calls this: postform_SetResult(true,"Your Name: ",namefield); the new string to be processed is (the value of 'namefield' is "postform_text-yourname").It's all well and good up to this point, but what if the user wants more that one string/variable? They could maybe call this:postform_SetResult(true,"Your Name: ",namefield,true,"\nYour Age: ",agefield); Which finally leads me to my actual question.How can I (if it's possible) have a function with infinite arguments that would be looped through in groups of 3 (condition, string, and variable) until they are all exhausted?
  7. There's a much better way of hiding spam messages than disabling the PM system...
  8. Just put your hand on the monitor and push as hard as you can, maybe something will happen.
  9. Whoops...Okay, so sorry to waste everyone's time, but it turns out it was a typo on my part that caused this whole debacle... (Apparently, forgetting to close the quotes on the src of a script element doesn't go over too well with my browser.)So, thank you everyone for your help, feel free to smack me for my stupidity.
  10. Deny from all is present in these locations: # First, we configure the "default" to be a very restrictive set of # features. #<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all</Directory> ## The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. #<FilesMatch "^\.ht"> Order allow,deny Deny from all</FilesMatch> I also found a few references to Alias: <IfModule alias_module> ScriptAlias /cgi-bin/ "C:/SERVER/XAMPP/cgi-bin/"</IfModule> LoadModule alias_module modules/mod_alias.so I have to admit I'm at a loss, I really have no idea what any of this does (I suppose I should...). I also strikes me as odd that the only pages that have this error are my own (trying to access scripts internally); plus, the PHP include/require still works.
  11. <Directory "C:/SERVER/XAMPP/htdocs"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks Includes ExecCGI # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Order allow,deny Allow from all</Directory>
  12. There are a few differences with mine, I'm not sure exactly what to change to fix this problem.The Directory is different (obviously)The 'Options' directive has that + Includes ExecCGIThe 'AllowOverride' is set to AllWhat should I change?
  13. Yes, the Zathyrus Networks ZetaBoards forum system has jQuery built in.justsomeguy: thanks, bookmarked
  14. I changed a few things, like the htdocs location and one or two other things; I don't remember exactly what.I suppose it's also worth pointing out that other webpages can link to scripts on my webserver, it's only my own pages that can't.
  15. Thanks for the replies. I first saw this on the support board for the Zathyrus ZetaBoards systems. Their forums have the jQuery framework built in (which I didn't know). As for not knowing where the DOM and framework meet, I'd like to consider myself a fairly competant JS user, so I think I can manage. And as far as downloading time goes, it's built in, so I see no reason not to use it.Thanks again,
×
×
  • Create New...