Jump to content
xisto Community
Tsunami

You Want It, I Can Make It Request some code

Recommended Posts

How about one of these?Given a chemical formula determine and display the structural formula of the chemicalImplement the A* searchGiven two vectors in component or r/theta form, display their dot and cross productsGood luck :)

Share this post


Link to post
Share on other sites

ill fiddle with it and i might make a simple one but there is absolutely no way ill do one that can do every possible chemical formula in the world >.<

Share this post


Link to post
Share on other sites

You would probably be better of splitting the post into an array with any non-alphanumeric character acting as a delimter, and using the number of items in the resulting array as the number of words. You may want to exclude words under a certain length as well (eg. anything less than 3 characters), possibly even run it by a dictionary file to make sure it isn't just gibberish. It's all possible and not particularly difficult, thanks to the beauty of regular expressions. Although I've spoken to Opaque about it in the past, I'm not sure whether or not the credit system here supports the re-calculation and deduction/addition of credits when a post is edited or deleted etc., but such functionality would certainly be nice.

The scipt now in use *does* adjust for edits. If you edit and add / deduct characters / words, credits are adjusted accordingly.
What I am not sure about is whether the script deducts when a posting is deleted. I suspect it does, but I cannot confirm that. Maybe Opaque will comment on that?

Share this post


Link to post
Share on other sites

EDIT: Forgot the Preview link XD Tsunami's YouTube Directory

ok... this script, for every one who doesnt know, is what bkag wanted but this wont be bkag's official code because i have to a lil tweaking to make it work for his site... but it will work for every one else... so DONT USE THIS CODE BKAG...

OK! This script is a YouTube Directory for your site... It allows users to add a movie by adding the ID, Category, Title, and a Description. All information is stored in a TEXT FILE. It then allows the users to browse the movies by title by letting them click on letters that correspond to the first letter in the title.

NEW FEATURES!!!
--Only allow users to click letters with movies in them
--Search Feature

the only drawback to the search feature is that you can only search one word with no spaces... its a simple search but it does its job...




ok... there are 2 files you will need... so lets get started:

Create a TEXT FILE with the .txt extension and put this as the first line:


//*TITLE |##| ID |##| DESCRIPTION |##| CATEGORY*//

Save the text file as movielist.txt

This doesnt really do any thing except act as a place holder for the first line.. i like to do this so that it can clarify things... it tells you exactly what is where...

Now lets make the main file shall we:

Create a PHP FILE with the .php extension and put this code in it and then Save as movies.php:


<?if($_GET['action'] != 'view'){?><head><title> YouTube Movie Directory</title><script language="javascript">function popV(titl,vide){var href;href='movies.php?action=view&t=' + titl + '&v=' + vide;window.open(href, 'profile', 'width=425,height=350,scrollbars=no,menubar=no,resizable=no');}function filterLineBreaks (ta) {  ta.value =	ta.value.replace(/\r\n|\r|\n/g, '<br>');}</script></head><?}?><?if($_GET['action'] != 'view'){$letters[0] = 'A';$letters[1] = 'B';$letters[2] = 'C';$letters[3] = 'D';$letters[4] = 'E';$letters[5] = 'F';$letters[6] = 'G';$letters[7] = 'H';$letters[8] = 'I';$letters[9] = 'J';$letters[10] = 'K';$letters[11] = 'L';$letters[12] = 'M';$letters[13] = 'N';$letters[14] = 'O';$letters[15] = 'P';$letters[16] = 'Q';$letters[17] = 'R';$letters[18] = 'S';$letters[19] = 'T';$letters[20] = 'U';$letters[21] = 'V';$letters[22] = 'W';$letters[23] = 'X';$letters[24] = 'Y';$letters[25] = 'Z';?><table width="100%"><tr><td><?$fileh = file("movielist.txt");foreach($fileh as $key => $val)$movie[$key] = explode("|##|",$val);sort($movie);$isany=0;$isthere=0;for($i = 0; $i < sizeof($letters); $i++){for($j = 1; $j < sizeof($fileh) && $isthere == 0; $j++){ if(ereg("^" . strtolower($letters[$i]),strtolower($movie[$j][0])))			 {				 $isthere = 1;			 }}if($isthere == 1){   echo "<a href='movies.php?letter=" . $letters[$i] . "'>" . $letters[$i] . "</a>";}else	echo $letters[$i];$isthere=0;if($i != 25 )   echo " - ";}?></td><td align=right><a href=movies.php?action=make>Submit a Movie</a></td></tr><tr><td colspan=2 align=right><form action="movies.php?action=search" method="GET"><input type=hidden name=action value=search><input type=text name=query <? if($_GET['action'] == 'search') echo "value=" . $_GET['query']; ?>><input type=submit value=Search!></form></td></tr></table><hr><?}if(!$_GET['action']){if(!$_GET['letter'])$letter = 'a';else$letter = strtolower($_GET[letter]);for($i = 1; $i < sizeof($fileh); $i++){if(ereg("^" . strtolower($letter),strtolower($movie[$i][0]))){echo "<b><a href=\"java script: popV('" . $movie[$i][0] . "','" . $movie[$i][1] . "');\"> " . $movie[$i][0] . "</a></b> - <i>" . $movie[$i][3] . "</i><br><i>" . $movie[$i][2] . "</i><hr>";$isany=1;}}if(!$isany)	echo "<center><i>None</i></center>";}if($_GET['action'] == "make"){?><center>	<form action='movies.php?action=add' method="POST" onsubmit="filterLineBreaks(this.disc)">	<table width="300"><tr><td>Movie Name: </td><td><input type=text name=name></td></tr><tr><td>Category</td><td><input type=text name=cat></td></tr><tr><td colspan=2>Description</td></tr><tr><td colspan=2><textarea name=disc rows=10 cols=30></textarea></td></tr><tr><td>Movie ID<font color=red>*</font>: </td><td><input type=text name=url></td></tr><tr><td colspan=2><center><input type=submit value="Add"></center></td></tr></table></form>	<br><center><font color=red>*</font>The ID for the movie is highlighted in red in the example below:<br>		   youtube.com/1YiOSKCMSe4/		   </center></center><?}if($_GET['action'] == "add"){   echo "<head><meta http-equiv='refresh' content='2; url=movies.php'/></head> Your movie was posted";	$fileh = fopen("movielist.txt",'a');	fwrite($fileh,"\r\n" . $_POST['name'] . "|##|" . $_POST['url'] . "|##|" . $_POST['disc'] . "|##|" . $_POST['cat']);	fclose($fileh);}if($_GET['action'] == "search"){$query = $_GET['query'];$isany = 0;for($i = 1; $i < sizeof($fileh); $i++){if(ereg(strtolower($query),strtolower($movie[$i][0])) || ereg(strtolower($query),strtolower($movie[$i][2])) || ereg(strtolower($query),strtolower($movie[$i][3]))){echo "<b><a href=\"java script: popV('" . $movie[$i][0] . "','" . $movie[$i][1] . "');\"> " . $movie[$i][0] . "</a></b> - <i>" . $movie[$i][3] . "</i><br><i>" . $movie[$i][2] . "</i><hr>";$isany=1;}}if(!$isany)	echo "<center><i>None</i></center>";}if($_GET['action'] == "view"){	$title = $_GET['t'];	$vid = $_GET['v'];	echo "<head><title>Viewing " . $title . "</title></head><body topmargin=0 leftmargin=0>";	echo '<object width="425" height="350"><param name="movie" value="youtube.com/watch?v=&%2339; . $vid . '"></param><param name="wmode" value="transparent"></param><embed src="youtube.com/watch?v=&%2339; . $vid . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></body>';}?>

b]Save as movies.php

There you are... i know its a little lengthy but it works none the less... if you dont want a youtube directory and you want something similar and you know a lil somthin somthin about php you should easily be able to customize this to your liking :-p

enjoy


PS. Bkag.... email me when you get online and ill email you your code :)

Notice from truefusion:
Changed to CODEBOX to reduce scrolling


Edited by OpaQue (see edit history)

Share this post


Link to post
Share on other sites

Ok, well recently on My Site we have added a new feature called Weekly Myspace Fan. And what i am looking for, is a script that will rotate a picture on the main page of my site (see my site, and the girls picture in the right hand column) and then possibly along with that picture it automaticly changed the content of an interview page to the interview that i had with the person in the picture?

it is hard to explain.

but basicly, i would like to be able to put all of the interviews in one big file, and every sunday night, the script will automaticly change the picture, and then put up the interview that i had with that person

PS: If you click on the Picture it iwll take you to the interview page, and that would be the questions i would put in , as well as the picture, and links etc.... Everything from the name (in this weeks case WOAH!! Its Molly) to the last question of How Long did it take you to read harry potter and the half blood prince.

So basicly like a PHP include i can put in the interview page that is including the page with the script that will change it weekely, and a php include script i can put in the right hand menu to change the picture along with the interview.

if you need more explination i will try :)

Edited by Albus Dumbledore (see edit history)

Share this post


Link to post
Share on other sites

I like your offer and want to take advantage of it, so here goes...

I am looking for script that allows a customer to make a purchase thru an integrated shopping cart (I am planning on using cubecart but I may use Paypal) and after payment is recieved the buyer will recieve an email with a link to a website where he can then enter his wireless phone number and have his purchases sent there (to his wireless phone).

Fun for mobile allows you to select what you want sent to your phone, enter your phone number then pay with paypal, which you then receive a text message on your wireless phone with the download link.

I dont have anything set up now, because this has been my biggest hurdle.

I also have a few reference sites for you, if you need to look at code:

Phone Uploader 1
and
Rumkin.com

Share this post


Link to post
Share on other sites

I have to say that YouTube directory is just... ownage. It's really really cool. All it needs is some html prettiness thrown on it and it's a professional site! :) You've got some talent there. I'd ask you to do something for me, because I can tell your really bored. But I figured it out on my own. Maybe some other time. :)

Share this post


Link to post
Share on other sites

I have to say that YouTube directory is just... ownage. It's really really cool. All it needs is some html prettiness thrown on it and it's a professional site! :) You've got some talent there. I'd ask you to do something for me, because I can tell your really bored. But I figured it out on my own.
Maybe some other time. :)



Tsunami also made some slight code modifications to make phpBB integrated version, it is so perfect, it fits in with evertything beautifuly, check it out http://forums.xisto.com/no_longer_exists/
Edited by Bkag (see edit history)

Share this post


Link to post
Share on other sites

okie dokie! this one i suppose is the most complicated but i tried to make it simpler to install...

 

Just so you know it automatically changes on the date that you assign and it only shows the ones that have been shown in the past and the current one in the archives NOT the ones to come... so you can do all the people for 20 years and it will show them 1 by 1 on the days that you assign them to!

 

PREVIEW!

MyspaceFan Main

Add New Fan Form

 

 

ok If you dont read the code at least READ THIS ENTIRE POST! so you dont mess up >.<

 

 

ok...

 

First everyone needs to create a TEXT file with a .txt extension called myfans.txt with this in it:

0

DO NOT PUT ANY LINE BREAKS OR CARRAIGE RETURNS IN THIS!!! its very important that you dont... now this is the last you will ever have to mess with this file if you do it right. ok... now if you are ALBUS DUMBLEDORE!!! make the file have this code in it instead:

3*|+*[+] Jurraietto [x]*|+|##|myspace.com/hp07gryffindor|%23#|My Name is julie|##|Since 5th grade|##|When my sister\'s best-friend, knows tht i like fantasy and magic, she told me tht i should read harry potter because she says tht it\'s very interesting and Magic, soo i went to Borders to buy it, and from therefore on i became a crazy harry Potter Fan ^^(tee-hee)|##|yes, i did.|##|my favorite book is Quidditch Through the Ages.|##|The Last Unicorn|##|I read The book and then i saw the Movie |##|Yes i\'m moore than glad, i\'m excited.|##|Daniel Radcliffe, because he does and Excelent Harry Potter Character, and i mean he got Harry\'s look the smile, the face, the surpise, the sad, the happy, the funny, the atituted, well except their favorite color the both have different favorite color.|##|All of Them!!|##|All of Them 2 ^^ i just love it and it\'s hard to choose which is which.|##|http://myspace-176.vo.llnwd.net/01192/67/17/1192087176_m.jpg|##|Because i Love harry potter and i Like the Fantasy and mysteries and it\'s Fun|##|3 Weeks, because i like to read nice and slowly not missing a word, and read every detail of it. ^^|##|1159142400*Jessica**taken**online*|##|http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=57603809|##|Jessica Reynolds|##|For about 5 years. Maybe 4 but i was in 8th grade and im graduated now; so i say 5 years|##|My little brother actually told me i should read them (my class did a book reading thing and whoever read the most got some extra points) when i couldn\'t find anything better to read. Then i borrowed The Sorcerer\'s Stone from the library|##|I have. More than once too.|##|I have to say Harry Potter and the Order of The Phoenix.|##|Definitly Harry Potter and the Prisoner of Azkaban|##|Read the book first.|##|I am.|##|It is a tie between Devon Murray and Tom Felton. I think they are both amazing actors and seem to be really cool guys. Plus, I think they are gorgeous.|##|Harry Potter and the Order of the Phoenix|##|Harry Potter and the Prisoner of Azkaban|##|http://myspace-255.vo.llnwd.net/01187/55/22/1187112255_m.jpg|##|I think it would be cool, i love Harry Potter and I want it to be known|##|It took me about 2 days off and on. i can\'t read the book in one sitting because of my brother and dogs. |##|1159747200WOAH!! its Molly|##|http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=59321138|##|Molly|##|umm...i think since i was 9|##|well when i first read the book i didn\'t really like it, b/c my parents made me read it, but then when i started reading the others for fun i really enjoyed them.|##|Yes|##|my favorite is Harry Potter and The Order of the Phoenix|##|Harry Potter and the Prisioner of Azkaban|##|well i saw the first couple movies before reading the book, but now i\'m ahead of the movies by two books|##|Yes|##|Dan Radcliffe, because he is very talented at portraying Harry Potter, and he\'s cute.|##|Harry Potter and the Order of the Phoenix|##|Harry Potter and the Prisoner of Azkaban|##|http://myspace-437.vo.llnwd.net/01258/73/47/1258317437_m.jpg|##|cause i love harry potter, and i just wanted to show how much of a fan i am!|##|A Day. |##|1160352000

Only Copy What is given make sure there are no stray carraige returns at the end. The reason i want you to use this is because it already has ur info for your ones already.

 

 

Now for the main code...

 

Create a PHP file with the .php extension called myspacefan.php with this code in it:


foreach($fileh as $key => $val)

$fan[$key] = explode("|##|", $val);

$id = $fileh[0] + 1;

 

if($fan[$id] && time() >= $fan[$id][16])

{

$file2 = fopen('myfans.txt','w');

fwrite($file2, $id . "\r\n");

for($i = 1; $i < sizeof($fileh); $i++)

{

fwrite($file2,$fileh[$i]);

}

fclose($file2);

}

 

 

if($_GET['action'] == 'form')

{

?>

<script language="javascript">

function selectDate(mylink){

if (! window.focus)return true;

var href;

if (typeof(mylink) == 'string')

href=mylink;

else

href=mylink.href;

window.open(href, 'getdate', 'width=308,height=235,scrollbars=no,menubar=no,resizable=no');

return false;

}

</script>

 

<form action="<? echo $fileincluded; ?>?action=add" method="POST" name=myspacefan>

<table width="300"><tr><td>Myspace Name linenums:0'><?$fileincluded = "myspacefan.php";$fileh = file('myfans.txt');foreach($fileh as $key => $val) $fan[$key] = explode("|##|", $val);$id = $fileh[0] + 1;if($fan[$id] && time() >= $fan[$id][16]){$file2 = fopen('myfans.txt','w');fwrite($file2, $id . "\r\n");for($i = 1; $i < sizeof($fileh); $i++){fwrite($file2,$fileh[$i]);}fclose($file2);}if($_GET['action'] == 'form'){?><script language="javascript">function selectDate(mylink){if (! window.focus)return true;var href;if (typeof(mylink) == 'string')href=mylink;elsehref=mylink.href;window.open(href, 'getdate', 'width=308,height=235,scrollbars=no,menubar=no,resizable=no');return false;}</script><form action="<? echo $fileincluded; ?>?action=add" method="POST" name=myspacefan><table width="300"><tr><td>Myspace Name:</td><td><input type=text name=mysname></td></tr><tr><td>Myspace URL:</td><td><input type=text name=url></td></tr><tr><td>Picture URL: </td><td><input type=text name=field11></td></tr><tr><td>Real Name: </td><td><input type=text name=rname></td></tr><tr><td>Why do you want to be listed here? </td><td><input type=text name=field12></td></tr><tr><td>How Long Have you Been a Fan? </td><td><input type=text name=field1></td></tr><tr><td>How did you First Pick it Up? </td><td><textarea rows=5 cols=15 name=field2></textarea></td></tr><tr><td>Have you read them all? </td><td><input type=text name=field3></td></tr><tr><td>Whats your favorite book? </td><td><input type=text name=field4></td></tr><tr><td>Whats your favorite movie? </td><td><input type=text name=field5></td></tr><tr><td>Did you see movie or book first?</td><td><input type=text name=field6></td></tr><tr><td>Glad We're your myspace friend? </td><td><input type=text name=field7></td></tr><tr><td>Fav. Actor in the movies & why? </td><td><textarea rows=5 cols=15 name=field8></textarea></td></tr><tr><td>Whats your favorite H.P book? </td><td><input type=text name=field9></td></tr><tr><td>Whats your favorite H.P movie? </td><td><input type=text name=field10></td></tr><tr><td>How long did it take to read H.P & the Half Blood Prince </td><td><textarea rows=5 cols=15 name=field13></textarea></td></tr><tr><td>Date when to show it? </td><td><input type=evtext name=date readonly><a href="myspacefan.php?action=datesel" onClick="return selectDate(this.href);">?</td></tr><tr><td colspan=2 align=center><input type=submit value=Add></td></tr></table></form><?}else if($_GET['action'] == "datesel"){?><html><head><title>Date Select</title><script language="JavaScript" type="text/javascript">var qsParm = new Array();function retrieveDATEFIELD() { var query = window.location.search.substring(1); var parms = query.split('&'); for (var i=0; i<parms.length; i++) { var pos = parms.indexOf('='); if (pos > 0) { var key = parms.substring(0,pos); var val = parms.substring(pos+1); qsParm[key] = val; } }}function insertDate(datedat) { var thedate = datedat; window.opener.myspacefan.date.value = thedate; window.close();}</script></head><BODY link="#6699ff" alink="#cc00cc" vlink="#cc00cc" text=white leftMargin=0 bottomMargin=0 topMargin=0 bgcolor="#000000" onLoad="retrieveDATEFIELD();"><?if(!isset($_REQUEST['date'])){ $date = mktime(0,0,0,date('m'), date('d'), date('Y')); } else { $date = $_REQUEST['date']; } $day = date('d', $date); $month = date('m', $date); $year = date('Y', $date); $month_start = mktime(0,0,0,$month, 1, $year); $month_name = date('F', $month_start); $daynumforside = date('j', $date);$daynameforside = date('l', $date);$month_start_day = date('D', $month_start); switch($month_start_day){ case "Sun": $offset = 0; break; case "Mon": $offset = 1; break; case "Tue": $offset = 2; break; case "Wed": $offset = 3; break; case "Thu": $offset = 4; break; case "Fri": $offset = 5; break; case "Sat": $offset = 6; break; } if($month == 1){ $num_days_last = cal_days_in_month(0, 12, ($year -1)); } else { $num_days_last = cal_days_in_month(0, ($month -1), $year); } $num_days_current = cal_days_in_month(0, $month, $year);for($i = 1; $i <= $num_days_current; $i++){ $num_days_array[] = $i; } for($i = 1; $i <= $num_days_last; $i++){ $num_days_last_array[] = $i; } if($offset > 0){ $offset_correction = array_slice($num_days_last_array, -$offset, $offset); $new_count = array_merge($offset_correction, $num_days_array); $offset_count = count($offset_correction); } else { $new_count = $num_days_array; } $current_num = count($new_count);if($current_num > 35){ $num_weeks = 6; $outset = (42 - $current_num); } elseif($current_num < 35){ $num_weeks = 5; $outset = (35 - $current_num); } if($current_num == 35){ $num_weeks = 5; $outset = 0; } // Outset Correction for($i = 1; $i <= $outset; $i++){ $new_count[] = $i; } $weeks = array_chunk($new_count, 7); $previous_link = "<a href=\"".$_SERVER['PHP_SELF']."?action=datesel&date="; if($month == 1){ $previous_link .= mktime(0,0,0,12,$day,($year -1)); } else { $previous_link .= mktime(0,0,0,($month -1),$day,$year); } $previous_link .= "\"><< Prev</a>"; $next_link = "<a href=\"".$_SERVER['PHP_SELF']."?action=datesel&date="; if($month == 12){ $next_link .= mktime(0,0,0,1,$day,($year + 1)); } else { $next_link .= mktime(0,0,0,($month +1),$day,$year); } $next_link .= "\">Next >></a>"; ?><table valign="top" align="center" width="300" border="1" class="outside" cellspacing="1" cellpadding="1" valing="top"><tr><td height="20" class="inside" valign="center"><h5 align="center"><?echo "<table width=300 align=\"center\">". "<tr>". "<td width=\"25%\" align=\"left\">$previous_link</td>\n". "<td width=\"50%\" align=\"center\">$month_name $year</td>\n". "<td width=\"25%\" align=\"right\">$next_link</td>\n". "</tr>\n". "</table>\n"; ?></h5></td></p></tr><tr><td valign="top"><p><?echo "<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\" class=\"calendar\">\n". "<tr>\n". "<td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td>\n". "</tr>\n"; $i = 0; foreach($weeks AS $week){ echo "<tr>\n"; foreach($week as $d){ if($i < $offset_count){ $day_link = "<a href=\"".$_SERVER['PHP_SELF']."?pageid=calendar&date=" .mktime(0,0,0,$month -1,$d,$year)."\">$d</a>"; echo "<td class=\"nonmonthdays\">$day_link</td>\n"; } if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset)){ if($date == mktime(0,0,0,$month,$d,$year)){ echo "<td class=\"today\">$d</td>\n"; } else { echo "<td class=\"days\"><a href=\"java script:insertDate(".mktime(0,0,0,$month,$d,$year).");\">$d</a></td>\n"; } } elseif($i >= ($num_weeks * 7) - $outset) { $day_link = "<a href=\"".$_SERVER['PHP_SELF']."?date=".mktime(0,0,0,$month +1,$d,$year)."\">$d</a>"; echo "<td class=\"nonmonthdays\">$day_link</td>\n"; } $i++; } echo "</tr>\n"; } echo '<tr><td colspan="7" class="days"> </td></tr>'; echo '</table>'; ?> </p> </td></tr></table><br><?}else if($_GET['action'] == 'add'){$fileh = fopen('myfans.txt','a');fwrite($fileh,"\r\n" . $_POST['mysname'] . "|##|" . $_POST['url'] . "|##|" . $_POST['rname'] . "|##|" . $_POST['field1'] . "|##|" . $_POST['field2'] . "|##|" . $_POST['field3'] . "|##|" . $_POST['field4'] . "|##|" . $_POST['field5'] . "|##|" . $_POST['field6'] . "|##|" . $_POST['field7'] . "|##|" . $_POST['field8'] . "|##|" . $_POST['field9'] . "|##|" . $_POST['field10'] . "|##|" . $_POST['field11'] . "|##|" . $_POST['field12'] . "|##|" . $_POST['field13'] . "|##|" . $_POST['date']);fclose($fileh);?><head><meta http-equiv='refresh' content='2; url=<? echo $fileincluded . "?action=archives"; ?>'/></head>This fan has been added and you are being redirected back to the Archives<?}else if($_GET['action'] == 'archives'){$fileh = file('myfans.txt');foreach($fileh as $key => $val) $fan[$key] = explode("|##|", $val);$thisone = $fileh[0];echo "<table width=300><tr><td><b>MYSPACE NAME</b></td><td><b>FAN DATE</b></td></tr>";for($i = 1; $i <= $thisone; $i++) { if($i == $thisone) echo "<tr><td><a href='" . $fileincluded . "?action=view'> <b>" . $fan[$i][0] . "</b></a></td><td><b>" . date("n/j",$fan[$i][16]) . "- " . date("n/j",$fan[$i][16] + 518400) . "</b></td></tr>";else echo "<tr><td> <a href='" . $fileincluded . "?action=view&id=" . $i . "'> " . $fan[$i][0] . "</a></td><td>" . date("n/j",$fan[$i][16]). "- " . date("n/j",$fan[$i][16] + 518400) . "</td></tr>"; }echo "</table>";}else if($_GET['action'] == 'view'){$fileh = file('myfans.txt');foreach($fileh as $key => $val) $fan[$key] = explode("|##|", $val);$thisone = $fileh[0];if ($_GET['id'])$id = $_GET['id'];else$id = $thisone + 1 - 1;echo "<center><b>Weekly Myspace Fan!</b><br><br>Click on their name or picture to go to their myspace page!<br><br><b><a href=" . $fan[$id][1] . ">" . $fan[$id][0] . "</b><br><br><img src='" . $fan[$id][13] . "'></a><br><br><b>First off, lets start with your name?</b><br>" . $fan[$id][2] . "<br><br><b>Why Do you want to be listed on hogwartsmagic.net?</b><br>". $fan[$id][14] ."<br><br><b>Now that we have that down, How long have you been a Harry Potter fan?</b><br>" . $fan[$id][4] . "<br><br><b>How did you first pick up a Harry Potter book?</b><br>" . $fan[$id][5] . "<br><br><b>Have You read all of the books?</b><br>" . $fan[$id][6] . "<br><br><b>What is your favorite Book?</b><br>" . $fan[$id][7] . "<br><br><b>What is your favorite movie?</b><br>" . $fan[$id][7] . "<br><br><b>Did you see the movie before you read the book or vice-versa?</b><br>" . $fan[$id][8] . "<br><br><b>Are you glad you added Hogwarts Magic as a friend on your myspace? </b><br>" . $fan[$id][9] . "<br><br><b>Who is your favorite actor in the Harry Potter movies and why? </b><Br>" . $fan[$id][10] . "<Br><br><b>What Harry Potter book is your favorite?</b><br>" . $fan[$id][11] . "<br><br><b>Which Harry Potter movie is your favorite? </b><br>" . $fan[$id][12] . "<br><br><b>How long did it take you to read Harry Potter and the Half Blood Prince? </b><br>" . $fan[$id][15] . "<br><br><a href='" . $fileincluded . "?action=archives'>View the Archives</a></center>";}else if(!$_GET['action']) { $fileh = file('myfans.txt');foreach($fileh as $key => $val) $fan[$key] = explode("|##|", $val);$id = $fileh[0] + 0;echo "<center><a href='" . $fileincluded . "?action=view'><b>Weekly Myspace Fan</b><br><img src='" . $fan[$id][13] . "' width='130' height='151'></a></center>";}?>

SETUP INSTRUCTIONS:

 

Ok... on your main php page where you want a picture of this weeks fan with a link on it... you need to put this code:

<?include("myspacefan.php");?>

Now you need to create a completely new php page, put your template and stuff on it and where you want the content to go put this code:

<?include("myspacefan.php");?>

wow... so different eh?

 

 

NOW FOR THE HARD PART!

in the main code on myspacefan.php you need to edit this

$fileincluded = "myspacefan.php";

 

edit the red text and make it the file name of the new php page you made that has the include script on it.

 

 

Now the only thing you dont have a link for in that script is the add a person page... and the url for that is

 

yourcontentpage.php?action=form

 

the red text is the same thing as the red text in the quote before... so just have fun with it! btw click the ? on the date field to select a date (built in calendar)

Share this post


Link to post
Share on other sites

Awesome script tsunami, although Im not a myspace regular I would assume that you can't use this directly into someones myspace page you have to connect through links and what not right?

Share this post


Link to post
Share on other sites

im not sure what you said but i think you may be right. I wish there was just some way to put in their url and get their myspace name and a picture url but sadly there isnt >.< hopefully this will be a lil easier that what albus is doing right now... with the form and all... but for people using the preview... just go ahead and add some people and what not... i suggest using yesterday's date... cause that would mean that it would be the next one in line... or use tommorrows date and see if it will switch over tommorrow or not...

Share this post


Link to post
Share on other sites

If I understand S_M correctly (which would mean that he wants to just plug in a person's MySpace name, and get their profile link), then you could do that, with th use of include() or require() to grab a page with a MySpace search or something. Keep in mind that I don't know the URL structure for MySpace, so don't quote me on anything I just said.

Share this post


Link to post
Share on other sites

excelent! thank you sooo much!!

I just have one problem, i followed all of your steps, and there is an error

http://forums.xisto.com/no_longer_exists/

if you look at the menu it has a PHP error >_<

also, wouldn't i need to chmod the .txt file?

Edited by Albus Dumbledore (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.