Jump to content

nitromaster

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by nitromaster

  1. Hi Basically I'm gonna have a swf on a page. This will get various variables via the standard flash procedure. I have no knowledge of flash. How easy would it be to create a swf to basically take all these variables, and pass them back to a php page as GET parameters? (want to use the php page to track them/etc) That's all my swf needs to do. Is this easy-ish? Is this even possible in a swf? Thanks
  2. Hi Basically I have the following scenario: User chooses picture from list. Picture info is added into the db, including url. However I can't figure out how exactly i should be storing the url for the image. What data type should i use? How to insert it/extract it (with the backlashes/etc neeeded) ? Should I store the full http://www.somesite.com/imageurl.jpg or just somesite.com/imageurl.jpg ? (as little as possible) How do i then display it? Had a quick search here...no luck finding what i'm looking for..had a look on google but ended up just finding info on the BLOB data type..which would be inserting the actual image binary data into the database i believe. Any help? Thanks Martyn
  3. Hi Basically I have apps on each of the major social networks (myspace/facebook/etc), as part of the app you can add one of the pictures from your photo albums on the site to the app. However, now I want to create/extend these apps, so after connecting your user ids on the different networks/apps, it'll show all the pictures you've added from the other sites. Currently my db is set up like so: photos table: fields: id - autoincrement number, unquie id for that image on the table. photo_id - non autoicrement, photo id, id of the photo the user has added. this isn't unquie, but as of right now is. owner - userid of the person who added the pic. profile_id - id of the profile they added the picture to, mostly their own. profile_type - type of profile, eg member/band/etc. and a similar table for each social network. (all seperate apps/seperate non connected info) Was thinking of doing it like this: New table/db for the "Whole system" thing. Some database structure like: table: photos fields: id - autoicrement social_network - the social network for which the photo comes from photo_id - photo id for that pic, related to the social network. could have more than two entries with same photo_id but different social_network. owner - userid of the owner of the pic, related to social network. profile_id - id of the profile they're adding to possibly. profile_type - type of profile they're adding to. url - url of the picture for display purposes and then having like users: fields: id - autoincrement id...probaly won't be used. facebook_id - user's facebook profile id myspace_id - user's myspace profile id facebook_auth - auth token/session key for the user's facebook profile. myspace_ auth - auth token/session key for the user's myspace profile. etc... Then, i think if i was on facebook and wanted to display all the user's added pics from all networks i could do like SELECT id, url FROM photos WHERE profile_id = currentuserid If i just wanted to show pics from one network I'd had an AND clause for that social network. Also, i need to figure out how to securely connect the various social network accounts. I presume if they were on facebook, i could generate an unique id which linked them to the myspace app..The myspace app then connected that unique id/facebook id with the myspaceid. Anyone got any thoughts on this? Would my structure above work or is there something i oversighted? Thanks
  4. Hi I'm a total newb at php....however I know how to list info from a multi-arrayed array (or whatever its called) from the facebook api. Like echo '<table>'; $columns = 4; $currCol = 1; $photos = $facebook->photos_get('', $_GET["aid"], ''); foreach($photos as $userData) { if ($currCol==1) { echo "<tr>"; } echo '<td><div style="text-align: center; padding: 10px;"> <a href="http://apps.facebook.com/myapp/add.php?fb_page_id=' . $page_id . '&aid=' . $userData['aid'] . '&owner=' . $userData['owner'] . '&pid=' . $userData['pid'] . '"> <fb:photo pid="' . $userData['pid'] . '" size="s" /> <br/> <a href="http://apps.facebook.com/myapp/add.php?fb_page_id=' . $page_id . '&aid=' . $userData['aid'] . '&owner=' . $userData['owner'] . '&pid=' . $userData['pid'] . '"> ' . $userData['caption'] . '</a></div></td>'; if ($currCol==$columns) { echo "<tr>"; $currCol=0; } $currCol++; } The returned arrays outputted above look like Array ( [0] => Array ( [pid] => 12402342 [aid] => 0 [owner] => 1 [src] => "http://bb.bebo.com/bb/medium/2005072816/1a12402342b495956441m.jpg" [src_big] => "http://bb.bebo.com/bb/large/2005072816/1a12402342b833304858l.jpg" [src_small] => "http://bb.bebo.com/bb/small/2005072816/1a12402342b733848302s.jpg" [link] => "http://www.bebo.com/PhotoAlbumBig.jsp?MemberId=1&PhotoAlbumId=0&PhotoId=12402342" [caption] => "13517565a18343b5945356l.gif" [created] => 1122569080000 ) [1] => Array ( [pid] => 5076242936 [aid] => 0 [owner] => 1 [src] => "http://i4.bebo.com/036a/15/medium/2007/06/21/14/4186319815a4748043833b623364386m.jpg" [src_big] => "http://i4.bebo.com/036a/15/large/2007/06/21/14/4186319815a4748043833b245635494l.jpg" [src_small] => "http://i4.bebo.com/036a/15/small/2007/06/21/14/4186319815a4748043833b523511584s.jpg" [link] => "http://www.bebo.com/PhotoAlbumBig.jsp?MemberId=1&PhotoAlbumId=0&PhotoId=5076242936" [caption] => "DSC00304" [created] => 1185318973000 ) ) However I'm having difficulties doing something similar with friends. As i said I'm a total newb. I can do the above where each album is in a array but cannot figure out how to list links with the friends.get method as they aren't in arrays. The returned data for friends.get is like Array ( [0] => 1 [1] => 2 ) Want to do something like a foreach with each id ending up outputting: <a href="http://apps.facebook.com/myapp/friend.php?fb_page_id=' . $page_id . '&friendid=' . $friendid . '"><br/> But no idea how to do this without each term being in an array. Any help? Thanks
  5. Hi all I have a facebook application. Basically the database part of it stores whatever photos user's have added to the app. I'm a total newb when it comes to php/mysql, can only do simple stuff. However the app has currently grown to just over 20k users, with phpmyadmin informing me there's 57,279 records added. I have no idea when this is going to be too big for me to handle (i am totally new to all this) Basically it's one table called "userphotos" 5 fields: id - bigint(20) profile_id - bigint(20) aid - bigint(20) owner - bigint(20) profile_type - varchar(20) latin1_swedish_ci None of the above null. I currently have my indexes like so Indexes: Keyname Type Cardinality Action Field profile INDEX 19094 profile_id I think this is right, because most of my queries are like (selecting from where that field = something) SELECT * FROM photos where profile_id='" . $profile_id . "' Should i worry about the increasing size of the database yet? or? (currently growing at 2-5k records a day i think) I've heard of slowdown/etc with large databases, but have no idea how long it's gonna be before i get to that stage. (I have no idea about any of this ) Thanks
  6. Okay. Eventually got it working with BigDump =)
  7. Hi Yes I have ftp support. I tried using bigdump but this kept throwing "delimiter" errors. How would I do it via command line? Thanks for your help.
  8. i could upgrade and get it enabled if needed. I mean if there's no other simple way.
  9. Hi Basically I have a dump of an sql file for my site, from a previous hosting which has now expired. Got new hosting, need to import it. It's only 2MB, pretty small i guess, but I have a really shit connection, and so far have fail to upload it to phpmyadmin via my web browser. Any idea on the best way to upload it would be? I was thinking of splitting it, but how? Or any other ideas would be great. Thanks
  10. It's in this file. To make sure it wasn't facebook.php, I changed to bebo (they have a compatible api/libary) to test first. And also removed config.php and just put the variables in this file. set.php <? require_once 'bebo.php'; $BEBO_API="YQmEbXMjdYTW38y00000000000000000000t"; $BEBO_SECRET="1lpji7Bto0jZyB6h600000000000000000000"; $bebo = new Bebo($BEBO_API, $BEBO_SECRET); $props = array( 'canvas_url' => 'http://www.mysite.com/7/'); $bebo->api_client->admin_setAppProperties($props); ?> PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/mysite/public_html/set.php on line 6 Really going over my head tbh. =/ Any ideas?
  11. Hi Full file is <? require_once 'facebook.php'; require_once 'config.php'; $bebo = new Facebook($FACEBOOK_API, $FACEBOOK_SECRET); $props = array( 'canvas_url' => 'http://www.site.com/someurl/'); $facebook->api_client->admin_setAppProperties($props); ?>
  12. Still nothing. Maybe my problem lies elsewhere? PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING on that line. Might be due to my version/set of php or whatever? (although i am using php 5) Thanks
  13. Hi Thanks for the reply, and pointing me towards what I should be doing. Yes, the facebook libary does actually enocde the data, should have read through it first Your way seems like it should work...but no matter what i seem to run into an error of something with the " => " bit when defining the array. I haven't really used arrays like so, much, recently. it's giving the following error PHP Parse error: syntax error, unexpected T_STRING in /home/mysite/set.php on line 19 Line 19 is 'canvas_url' => "http://www.site.com/someurl/", I've only been able to get other errors, when trying it some other way like PHP Parse error: syntax error, unexpected T_DOUBLE_ARROW PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING Any idea? Thanks And thanks to the rest of the repliers
  14. Hi I need to pass in information via a JSON to a function. The JSON array is as follows {"canvas_url":"http://www.site.com/someurl/"} Need to pass that into $facebook->api_client->admin_setAppProperties($jsonarray); where $jsonarray = that array Of course $facebook->api_client->admin_setAppProperties({"canvas_url":"http://www.site.com/someurl/"}); doesnt work. Neither does $jsonarray = '{"canvas_url":"http://www.site.com/someurl/"}'; $facebook->api_client->admin_setAppProperties($jsonarray); I've tried countless other things I could think about but still failed. What should I be looking at doing with the array? I had a look at json encode/decode as well but these seem not useful to me as I'm working with total static arrays. Thanks
  15. Tearing my head out over this http://validator.w3.org/feed/check.cgi?url=www.mybebostuff.com%2Ffeeds%2Fthelonelyisland.xml Basically seems like there's a problem with this line <media:player url="http://www.youtube.com/watch?v=eh2ld_Vt_eQ><![CDATA[<embed src="http://www.youtube.com/v/eh2ld_Vt_eQ&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed>]]></media:player> Any idea why it's not valid? In a much older media rss file I have <media:player url="http://www.break.com/index/atv-jumps-into-tree.html"><![CDATA[<embed src="http://embed.break.com/NTc4NzA1" type="application/x-shockwave-flash" wmode="transparent" width="464" height="392" ></embed>]]></media:player> And that's valid. Any ideas?
  16. Was away since so didn't get to have another look at this until now. Seems the encoding got messed up around there and when I viewed via the edit page in cpanel file manager it showed ÊifÊ(mysql_affected_rows($query)Ê>Ê0)Ê{ ÊÊÊÊÊÊÊÊÊÊÊÊechoÊ"CommentsÊinserted\n"; ÊÊÊÊÊÊÊÊ} Whoops, no wonder it was having problems :L
  17. It looked like he just typed that in cause it don't appear that way in the code he pasted. Though I can't say for sure cause he hasn't responded. Whoops, I typed that, not in my code.
  18. Currently creating a comment function for an app I have running on facebook. I'm getting an error on the addcomment page though. [31-Dec-2008 20:55:40] PHP Parse error: syntax error, unexpected T_STRING in directory/addcomment.php on line 32 Line 32 is mysql_query{$query); with $query set above. Full page code is as follows facebook.php is the facebook api lib, config.php defines mysql user/database and api key/secret. userid is set to the userid of whoevers using the app. <?php require_once 'facebook.php'; require_once 'config.php'; $facebook = new Facebook($FACEBOOK_API, $FACEBOOK_SECRET); $user_id = $facebook->require_login(); if(isset($_POST['commentplz'])) { $poster_id = $_POST['fb_sig_user']; $admin_id = $_POST['fb_sig_user']; $member_id = $_POST['to']; $message_tx = mysql_real_escape_string($_POST['message_tx']); $photo_id = $_POST['photo_id']; $timestamp = time(); } else { echo '<fb:redirect url="http://apps.facebook.com/appname/" />'; } echo '<fb:tabs> <fb:tab-item href="http://apps.facebook.com/appname/" title="Index" selected="true"/> <fb:tab-item href="http://apps.facebook.com/appname/invite.php" title="Invite Friends"/> <fb:tab-item href="http://apps.facebook.com/appname/mycomments" title="My Received Comments"/> </fb:tabs>'; mysql_connect($SQL_HOST,$SQL_USER,$SQL_PASS) or die(mysql_error()); @mysql_select_db($SQL_DB) or die( "Unable to select database"); $query = "INSERT INTO comments VALUES ('" . $poster_id . "','" . $admin_id . "','" . $member_id . "', '" . $message_tx . "', '" . $photo_id . "', '" . $timestamp . "')"; mysql_query($query); if (mysql_affected_rows($query) > 0) { echo "Comments inserted\n"; } else { echo "Error"; } mysql_close(); ?> Any ideas? Probaly something really easy but I've looked over it a few times and it all looks good ??? Thanks
  19. Both bits of code that there was problems with were copy/pastied from elsewhere without me properly checking them. Got it sorted now, thanks for fixing that
  20. Thanks removed that line and I'm getting closer. Now getting PHP Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' on line <a href="http://apps.facebook.com/appname/add1.php?fb_page_id=' . $page_id . '&aid={$userData['aid']}&owner={$userData['owner']}"> (i removed the blank fb_page_id parameter in my tests as well to rule out any problems there)
  21. Have a problem here with a facebook app. I had a add.php file which basically got photos from facebook via their api depending on get parameters (aid, pid, owner, etc) and then inserting data into my db if it passed in all info basically. Problem was I was outputting all photos/albums to a single row. In another topic I got a helpful reply giving me a pretty good idea of where I should be going with the code. This is what I have as my main add.php now with a unexpected t_foreach error. (I originally had only one add.php with if statements depending on what was present but I'm going for multiple ones until i get this sorted at least ) <?php // Requiring facebook api lib + app config require_once 'facebook.php'; require_once 'config.php'; // Defining the facebook object with api key and secret and defining user_id as logged in-added user. $facebook = new Facebook($FACEBOOK_API, $FACEBOOK_SECRET); $user_id = $facebook->require_add(); $profile_id = $user_id; $profile_type = Member; echo '<table>'; $columns = 5; $currCol = 1; $photos = $facebook->photos_getAlbums($profile_id, ''); $total = count($photos) foreach($photos as $userData) { if ($currCol==1) { echo "<tr>\n"; } echo '<td><div style="text-align: center; padding: 10px;"> <a href="http://apps.facebook.com/appname/add1.php?fb_page_id=' . $page_id . '&aid={$userData['aid']}&owner={$userData['owner']}"> <sn:photo pid=\"{$userData['cover_pid']}\" size="s" /><br/> <a href="http://apps.facebook.com/appname/add1.php?fb_page_id=' . $page_id . '&aid={$userData['aid']}&owner="{$userData['owner']}"> {$userData['name']}</a><br/>{$userData['size']} photos</div></td>'; if ($currCol==$columns) { echo "<tr>n"; $currCol=0; } $currCol++; } echo '</table>'; ?> $photos is returned as: Array ( [0] => Array ( [aid] => 91107396551212 [cover_pid] => 911075535353 [owner] => 1 [name] => "A" [created] => 1223671096000 [modified] => 1223671219000 [description] => [location] => [link] => "http://www.facebook.com/photos?aid=91107396551212" [size] => 1 ) [1] => Array ( [aid] => 91153507613520 [cover_pid] => 91423743263186 [owner] => 1 [name] => "B" [created] => 1223671234000 [modified] => 1223671248000 [description] => [location] => [link] => "http://www.facebook.com/photos?aid=91153507613520" [size] => 1 ) ) from the api
×
×
  • 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.