Jump to content

noexcal

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

noexcal's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. All though this was my fault, and stupidity for forgetting to change the start of that line. I tested this first, before everything and it through errors because of the $friend part. It is really late, and I am tired.. and sometimes taking a second can fix a lot of issues ;[ adding $app_user = new se_user(); $app_user->user_info[user_id] = $app_info[user_id]; $app_user->user_info[app_info1] = $app_info[app_info1]; //$app_user->user_info[app_info3] = $app_info[app_info3]; $app_user->user_info[item_id] = $app_info[item_id]; $app_user->user_info[profile] = $app_info[profile]; $app_user->user_info[name] = $app_info[name]; $app_user->user_info[height] = $app_info[height]; $app_user->user_info[width] = $app_info[width]+10; worked. but also I did have to add the & in front of the $app_array[] = &$app_user; or it would only show 1 result.
  2. Yeah, its not really required for any reason I can think of. but I did add it to see if I was wrong, didn't change anything. ;[
  3. Alright, idk what good this will do but here is one that does work. it is the template I used for making this one.. and it works fine. // SET VARIABLE $friend_array = Array(); // MAKE SURE CONNECTIONS ARE ALLOWED if($setting[setting_connection_allow] != 0) { // BEGIN FRIEND QUERY $friend_query = "SELECT se_friends.friend_id, se_users.user_id, se_users.user_username, se_users.user_photo, se_users.user_lastlogindate, se_users.user_dateupdated"; // GET FRIEND EXPLAIN, IF NECESSARY if($friend_details == 1) { $friend_query .= ", se_friends.friend_type, se_friendexplains.friendexplain_body"; } // CONTINUE QUERY $friend_query .= " FROM se_friends LEFT JOIN se_users ON"; // MAKE SURE TO JOIN ON THE CORRECT FIELD (DEPENDENT ON DIRECTION) if($direction == 1) { $friend_query .= " se_friends.friend_user_id1=se_users.user_id"; } else { $friend_query .= " se_friends.friend_user_id2=se_users.user_id"; } // JOIN ON FRIEND EXPLAIN TABLE, IF NECESSARY if($friend_details == 1) { $friend_query .= " LEFT JOIN se_friendexplains ON se_friends.friend_id=se_friendexplains.friendexplain_friend_id"; } // CONTINUE QUERY $friend_query .= " WHERE friend_status='$friend_status'"; // EITHER "LIST OF WHO USER IS A FRIEND OF" OR "LIST OF USER'S FRIENDS" if($direction == 1) { $friend_query .= " AND friend_user_id2='".$this->user_info[user_id]."'"; } else { $friend_query .= " AND friend_user_id1='".$this->user_info[user_id]."'"; } // ADD ADDITIONAL WHERE CLAUSE IF EXISTS if($where != "") { $friend_query .= " AND $where"; } // SET SORT AND LIMIT $friend_query .= " ORDER BY $sort_by LIMIT $start, $limit"; // LOOP OVER FRIENDS $friends = $database->database_query($friend_query); while($friend_info = $database->database_fetch_assoc($friends)) { // CREATE AN OBJECT FOR FRIEND $friend = new se_user(); $friend->user_info[user_id] = $friend_info[user_id]; $friend->user_info[user_username] = $friend_info[user_username]; $friend->user_info[user_photo] = $friend_info[user_photo]; $friend->user_info[user_lastlogindate] = $friend_info[user_lastlogindate]; $friend->user_info[user_dateupdated] = $friend_info[user_dateupdated]; // SET FRIEND TYPE/EXPLANATION VARS if($friend_details == 1) { $friend->friend_type = $friend_info[friend_type]; $friend->friend_explain = $friend_info[friendexplain_body]; } // SET FRIEND ARRAY $friend_array[] = $friend; } } // RETURN FRIEND ARRAY return $friend_array; } // END user_friend_list() METHOD Now that one does alot of different stuff in the database, and checks different things. but for the main part it pulls the array the same way.
  4. t This might actually work if I could figure out how to pass it to the template files (I use smarty) and the class wont pass right, I will play around more with this same with the any of the other ones that change the " $app_user->user_info" part. One or the other of these might work - $app_array[] = (object)$app_user; $app_array[] = &$app_user; Neither one of these worked, but thank you for telling me the difference. I will continue to work with this, and if I do solve it, I will post that I did.
  5. Array ( [item_id] => 3 [user_id] => 1 [app_info1] => 9d5dcc74-02bd-4b43-a32f-89dd7b2ca395 [app_info2] => 1 [app_info3] => 7bf5a704-a7f6-4891-95a4-1ee8059b9b87 [name] => The Simpsomaker 3 [width] => 400 [height] => 313 [profile] => 1 [order_id] => 3 ) Array ( [item_id] => 2 [user_id] => 1 [app_info1] => 4ad12e98-b9e8-41de-a56c-506db58fc680 [app_info2] => 1 [app_info3] => ba85f3b0-99d8-4e18-9a54-135521dbcaa1 [name] => Facedouble Widgetbox [width] => 400 [height] => 300 [profile] => 1 [order_id] => 2 ) Yep, that returned the correct results. ;o Still lost tho.. lol, I know now that its happening somewhere between there and when it returns the final array. but what has changed between php4 and 5 that would cause this.
  6. I take that back, enabling that just screwed up a bunch of stuff that requires php5.. ;[ And I did look into what was looping it. I decided just to print_r it to check to see if it was coming from that end or not. and print_r returns this. Array ( [0] => stdClass Object ( [user_info] => Array ( [user_id] => 1 [app_info1] => 4ad12e98-b9e8-41de-a56c-506db58fc680 [item_id] => 2 [profile] => 1 [name] => Facedouble Widgetbox [height] => 300 [width] => 410 ) ) [1] => stdClass Object ( [user_info] => Array ( [user_id] => 1 [app_info1] => 4ad12e98-b9e8-41de-a56c-506db58fc680 [item_id] => 2 [profile] => 1 [name] => Facedouble Widgetbox [height] => 300 [width] => 410 ) ) ) as you can see both arrays contain the same data.. when they should not. in php4 it returns this Array ( [0] => stdClass Object ( [user_info] => Array ( [user_id] => 1 [app_info1] => 9d5dcc74-02bd-4b43-a32f-89dd7b2ca395 [item_id] => 3 [profile] => 1 [name] => The Simpsomaker 3 [height] => 313 [width] => 410 ) ) [1] => stdClass Object ( [user_info] => Array ( [user_id] => 1 [app_info1] => 4ad12e98-b9e8-41de-a56c-506db58fc680 [item_id] => 2 [profile] => 1 [name] => Facedouble Widgetbox [height] => 300 [width] => 410 ) ) )
  7. zend.ze1_compatibility_mode=on in php5.ini fixed it. idk really what that is, but I went through all the things in the phpinfo and that one fixed it, can someone tell me what that is?
  8. function user_app_list() { global $database, $setting; // SET VARIABLE $app_array = Array(); // BEGIN FRIEND QUERY $app_query = "SELECT * FROM se_apps WHERE user_id='".$this->user_info[user_id]."' AND app_info2=1 AND profile=1 ORDER BY order_id ASC LIMIT 0,30"; // LOOP OVER FRIENDS $app = $database->database_query($app_query); while($app_info = $database->database_fetch_assoc($app)) { // CREATE AN OBJECT FOR FRIEND $app_user->user_info[user_id] = $app_info[user_id]; $app_user->user_info[app_info1] = $app_info[app_info1]; //$app_user->user_info[app_info3] = $app_info[app_info3]; $app_user->user_info[item_id] = $app_info[item_id]; $app_user->user_info[profile] = $app_info[profile]; $app_user->user_info[name] = $app_info[name]; $app_user->user_info[height] = $app_info[height]; $app_user->user_info[width] = $app_info[width]+10; // SET FRIEND ARRAY $app_array[] = $app_user; } // RETURN FRIEND ARRAY return $app_array; } // END user_applist() METHOD this returns how many ever items are in the array (wether it be 1 or 2) it knows how many are there, but it shows the same item for all items.
  9. Alright, I have to use php5 because of new functions. So far I have had no problems, but came across one. In php4 this worked fine and returned the correct results, but in php5 it knows how many items are in the array but shows the same item for each represented item. (Example) in php4 I would pull "Item1" and "Item2" and then pull those items and on the page I would get "Item1" and "Item2" in php5 I pull "Item1" and "Item2" but it shows on the page "Item1" and "Item1" it does not show "Item2" here is the php code I am using. $some_query = $database->database_query("SELECT * FROM table WHERE id=3 ORDER BY order_id ASC LIMIT 30"); $some_array = Array(); while($some = $database->database_fetch_assoc($some_query)) { $some_stuff->id[id] = $some[user_id]; $some_array[] = $some_user; } ignore any obvious weird errors, as I changed all the info. but if you see any errors in the main code please tell me what has changed in php5?
  10. oh sorry, xss attacks such as were used to attack myspace. <img src="http://site.com/deleteuser?task=dodelete"> stuff like that. I only want to allow img tags that are gif jpg jpeg png
  11. I need to replace invalid img tags on submit. PHP will preg_replace <img src="http://somesite.com/script.php"> but will allow <img src="http://somesite.com/image.gif"> something like $field = preg_replace('!\<img(.*)src=\"^(http|https)\:\/\/(.*)\"(.*)\.^(jpg|gif|jpeg|png)(.*)\>!i', '..', $field); That does not work, but you get the main idea. I do not need some long code, I know this can be done simple, because I have done similar stuff.. For some reason I just get stuck on this one.
  12. Alright on my site people can post "widgets" I want to search these inputs for certain urls. Right now it takes all embed codes and does this <embed src="blah.swf"> turns to <embed enableJSURL="false" enableHREF="false" saveEmbedTags="true" allowScriptAccess="never" allownetworking="internal" src="blah.swf"> What I want to do, is have a white list. the white list will look something like 'youtube.com' 'myflashfetish.com' and I want the regex to check the src="blah.swf' so if the regex saw <embed src="youtube.com?v=3242"> or <embed src="myflashfetish.com/somethingstupid.swf"> it would ignore it. but if it saw anything else it would do the replacing.
  13. Alright here is the deal. When a user uploads an mp3, I need php to check the bitrate. If the bitrate is bigger than 128kbps I need to reduce it to 128. Is this possible? well.. I know it is because other sites do it, But is it with php or something else.
×
×
  • 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.