WIN artys!

Anything regarding UO or Age of Valor
Locked
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

WIN artys!

Post by Red Squirrel »

If you can say what this line of code does, you can WIN a FREE pair of CLAWS OF THE HOLY SQUIRREL!

I have 3 pairs sitting at my house. Got my 3rd last night off a mob while I soloed rikktor.

Code: Select all

foreach($_POST as $arg=>$val)if(preg_match("/^setting_/",$arg)) $vararray[str_replace("setting_","",$arg)]=SBsqlFixPost($val);	
Archived topic from AOV, old topic ID:343, old post ID:1760
Honk if you love Jesus, text if you want to meet Him!
dead-eye
Posts: 38
Joined: Fri Dec 15, 2006 7:17 pm

WIN artys!

Post by dead-eye »

Red Squirrel wrote:If you can say what this line of code does, you can WIN a FREE pair of CLAWS OF THE HOLY SQUIRREL!

I have 3 pairs sitting at my house. Got my 3rd last night off a mob while I soloed rikktor.

Code: Select all

foreach($_POST as $arg=>$val)if(preg_match("/^setting_/",$arg)) $vararray[str_replace("setting_","",$arg)]=SBsqlFixPost($val);	
It searches and fixes settings on posts.


Do i win?

lol.


OR... It makes valorite ore pregnant and matches who the daddy is :P.

Archived topic from AOV, old topic ID:343, old post ID:1764
I am Dead-Eye

Evp for life

WoW
Hordan-70 pally
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

WIN artys!

Post by Red Squirrel »

Close, but I should give some kind of indication of where it's used. It's for a forum script I'm coding. $_POST is an array with any information send via a form when you hit submit.

Archived topic from AOV, old topic ID:343, old post ID:1769
Honk if you love Jesus, text if you want to meet Him!
dead-eye
Posts: 38
Joined: Fri Dec 15, 2006 7:17 pm

WIN artys!

Post by dead-eye »

Red Squirrel wrote:Close, but I should give some kind of indication of where it's used. It's for a forum script I'm coding. $_POST is an array with any information send via a form when you hit submit.
i knew it was for forums.

Alright so heres what it does.

It part of the coding in our EVP application form that links Demise/Valor...

Maybe?

i have no clue how to code, or even what half that stuff means.

Archived topic from AOV, old topic ID:343, old post ID:1772
I am Dead-Eye

Evp for life

WoW
Hordan-70 pally
User avatar
Gaiava Arkkaza
Posts: 834
Joined: Tue Dec 12, 2006 10:19 pm

WIN artys!

Post by Gaiava Arkkaza »

SquirrelBBL? :P

Archived topic from AOV, old topic ID:343, old post ID:1773
Brunus
Nosferatu
Posts: 797
Joined: Thu Mar 15, 2007 4:36 pm

WIN artys!

Post by Nosferatu »

for each post that has (something innapropriate?) it prevents the post and sends it to the fix post menu?

Archived topic from AOV, old topic ID:343, old post ID:1774
What?
User avatar
Death
Posts: 7919
Joined: Thu Sep 30, 2004 10:12 pm

WIN artys!

Post by Death »

Something along the lines of for each post with a certain string condition, the string gets changed. The string itself seems to pertain to "settings" so I'm assuming that for every post where the settings are changed, the rest of the posts settings will be changed.

Archived topic from AOV, old topic ID:343, old post ID:1776
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

WIN artys!

Post by Red Squirrel »

Your on the right track. But to not put too much essence on that sqlfixpost function, all that does is clean up the data of any inappropriate data that could be used to inject commands in the database. Other then that, it does not do anything special.

Also, it's part of the admin interface.

Archived topic from AOV, old topic ID:343, old post ID:1777
Honk if you love Jesus, text if you want to meet Him!
User avatar
Death
Posts: 7919
Joined: Thu Sep 30, 2004 10:12 pm

WIN artys!

Post by Death »

Red Squirrel wrote:Your on the right track. But to not put too much essence on that sqlfixpost function, all that does is clean up the data of any inappropriate data that could be used to inject commands in the database. Other then that, it does not do anything special.

Also, it's part of the admin interface.
Actually, it was the "preg_match" part that got me thinking wtf. Not sure what the preg part denotes.

Archived topic from AOV, old topic ID:343, old post ID:1779
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

WIN artys!

Post by Red Squirrel »

perg_match checks for a regular expression match in a string. looking up foreach might help as well. :wink:

Archived topic from AOV, old topic ID:343, old post ID:1780
Honk if you love Jesus, text if you want to meet Him!
User avatar
Death
Posts: 7919
Joined: Thu Sep 30, 2004 10:12 pm

WIN artys!

Post by Death »

Red Squirrel wrote:perg_match checks for a regular expression match in a string. looking up foreach might help as well. :wink:
if it's anything like VB/C# for each is a conditional loop for elements of an array. It loops until the maxlength of the array.

Archived topic from AOV, old topic ID:343, old post ID:1781
User avatar
E.Machine
Posts: 620
Joined: Thu Dec 21, 2006 10:57 pm

WIN artys!

Post by E.Machine »

It loops through the Submitted information, and assigns it to $arg=>$val.
if that variable is /^setting_/ replace it with setting_

in the foreach loop the current element's key will be assigned to $arg

and the value of the post will be assigned to $var

replaces any occurance of setting_ with nothing in the variable arg

takes everything in $_POST[] that starts with setting_ and stores in another array

that about right?

Archived topic from AOV, old topic ID:343, old post ID:1783
=A= Animosity
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

WIN artys!

Post by Red Squirrel »

You're pretty close I'll give it to you.

What it does is it loops through the $_POST array, and if the index name starts with setting_ then it assigns the value to another array, but instead of the index being called setting_nnn it's just nnn.

So if a form field's name is setting_test

then $_POST[setting_test] would be put in $vararray[test]

in php instead of arrays using numbers they use names, but you can also refer to their numbers.

If you expand it, its actually simple. Just looks like haxor code when its on one line :P

Code: Select all

foreach($_POST as $arg=>$val)
{
  if(preg_match("/^setting_/",$arg)) 
  {
  $vararray[str_replace("setting_","",$arg)]=SBsqlFixPost($val); 
  }
}

Archived topic from AOV, old topic ID:343, old post ID:1784
Honk if you love Jesus, text if you want to meet Him!
Lymus
Posts: 737
Joined: Wed Dec 13, 2006 2:21 pm

WIN artys!

Post by Lymus »

2,000 pigs for whoever knows what this code does

Code: Select all

color 0a

cmd

ping uovalor.com

tracert uovalor.com
Archived topic from AOV, old topic ID:343, old post ID:1785
If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.
Nosferatu
Posts: 797
Joined: Thu Mar 15, 2007 4:36 pm

WIN artys!

Post by Nosferatu »

Nosferatu wrote:for each post that has (something innapropriate?) it prevents the post and sends it to the fix post menu?
lol my first post on aov :D

Archived topic from AOV, old topic ID:343, old post ID:28511
What?
Locked