|
|
Help Me Humpa PHP and MMS Server Help
|
| View previous topic :: View next topic |
| Author |
Message |
dacool25
Joined: 29 Apr 2007 Posts: 60
|
Posted: Mon May 28, 2007 2:57 pm Post subject: |
|
|
I tried that code, but the top large image isn't being displayed. But line 151 isn't commented out.
EDIT - Nevermind it was line 241. But how come now when it comes up it doesn't have an image? I have to click on one first. |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Mon May 28, 2007 3:00 pm Post subject: |
|
|
| dacool25 wrote: |
| I tried that code, but the top large image isn't being displayed. But line 151 isn't commented out. |
The top image isn't displayed until you click on the text under a pic. That's what you said you wanted. |
|
| Back to top |
|
 |
dacool25
Joined: 29 Apr 2007 Posts: 60
|
Posted: Mon May 28, 2007 3:01 pm Post subject: |
|
|
| I apologize, i had to change that because i still needed a way to delete the photos. |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Mon May 28, 2007 3:02 pm Post subject: |
|
|
If you always want a pic up top, then put this back to normal:
| Code: |
//if(($media == $media_time OR ($media == "" AND $count == 1)) && $first_media != "done") {
if($media == $media_time && $first_media != "done") {
show_first_media($this_media_group,$media_time,$media_time_all);
$media = $media_time;
$first_media = "done";
} |
like so:
| Code: |
if(($media == $media_time OR ($media == "" AND $count == 1)) && $first_media != "done") {
show_first_media($this_media_group,$media_time,$media_time_all);
$media = $media_time;
$first_media = "done";
} |
And I think you might have to uncomment line 241 ... you want both the show_first_media lines like normal. |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Mon May 28, 2007 3:04 pm Post subject: |
|
|
| dacool25 wrote: |
| I apologize, i had to change that because i still needed a way to delete the photos. |
lol ... good point. But clicking on a pic will put it up there.
Anyway, now you know how to do it either way ... so just use whichever way you prefer. |
|
| Back to top |
|
 |
dacool25
Joined: 29 Apr 2007 Posts: 60
|
Posted: Mon May 28, 2007 3:07 pm Post subject: |
|
|
Thanks again for everything Humpa.
Just one last question, which part of the code handles the first image that comes up when you first load the page?
EDIT - Once again, i'm an idiot sorry, you posted it before. Everything works flawlessly now Humpa. Thanks for everything!!!!!! |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Mon May 28, 2007 3:12 pm Post subject: |
|
|
| dacool25 wrote: |
Thanks again for everything Humpa.
Just one last question, which part of the code handles the first image that comes up when you first load the page?
EDIT - Once again, i'm an idiot sorry, you posted it before. Everything works flawlessly now Humpa. Thanks for everything!!!!!! |
Just to simplify, if you want a default pic showing, then use this:
| Code: |
if(($media == $media_time OR ($media == "" AND $count == 1)) && $first_media != "done") {
//if($media == $media_time && $first_media != "done") { |
And leave the show_first_media on line 241 like normal.
If you don't want a default pic (and only pic when you click), then use this:
| Code: |
//if(($media == $media_time OR ($media == "" AND $count == 1)) && $first_media != "done") {
if($media == $media_time && $first_media != "done") { |
and comment out line 241 show_first_media
So, you can go back and forth by just commenting out a couple of lines (or uncommenting) |
|
| Back to top |
|
 |
GeneralGau
Joined: 29 May 2007 Posts: 1
|
Posted: Tue Jun 12, 2007 8:02 am Post subject: |
|
|
| Humpa wrote: |
you need to edit your functions.php and your style sheet, but you seemed to already have that done correctly
|
Rather than re-invent the wheel, any way you could post your functions.php here?
I use Gallery for non-camera phone pictures, along with PGLightbox theme, and the PG Charcoal colorpack.
I'd like to somewhat mirror that look for my mms server; I have the css file done, just figure since you had a working copy of the Lightbox done (and I'm more of a hack when it comes to php), I just ask for yours...
Thanks. |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Tue Jun 12, 2007 8:59 am Post subject: |
|
|
Here is my functions.php for lighthouse:
| Code: |
<?php
global $use_uplink;
if($use_uplink == "yes") {
$uplink = "../";
}else {
$uplink = "";
}
function head() {
include("config.php");
global $uplink,$page_title,$style_cookie,$stlye1,$$style_cookie;
$style_cookie_file = $$style_cookie;
if($style_cookie != "" AND file_exists("$uplink$style_cookie_file")) {
$style1 = "$style_cookie_file";
}
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
echo "<html>\n";
echo "<head>\n";
echo "<title>$page_title</title>\n";
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">\n";
echo "<LINK REL=\"StyleSheet\" HREF=\"style_lightbox.css\" TYPE=\"text/css\">\n";
$lightbox = '<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
';
echo $lightbox;
echo "</head>\n";
echo "<body>\n";
}
function foot() {
echo "</body>\n";
echo "</html>\n";
}
function style_cookie_form() {
global $number_styles,$style,$style_cookie;
$content = "<form action=\"set_cookie.php\" method=\"POST\" name=\"edit\">\n";
$content .= "\t<SELECT size=1 name=\"style_cookie_set\" onChange=\"this.form.submit();\">\n";
if($style_cookie != "") {
$style_selected = "$style_cookie";
}else {
$style_selected = "style1";
}
$i = 1;
while($i <= $number_styles) {
global $this_style;
$this_style = "style$i";
global $$this_style;
$this_style_ = $$this_style;
if($this_style != "") {
if($style_selected == "style$i") {
$selected = " selected";
}else {
$selected = "";
}
$content .= "\t<OPTION VALUE=\"style$i\"$selected>$this_style</OPTION>\n";
}
$i++;
}
$content .= "\t</SELECT>\n\t<NOSCRIPT>\n\t<INPUT type=submit value=\"Go\">\n\t</NOSCRIPT>\n";
$content .= "\t<input type=\"hidden\" value=\"set_style_cookie\" name=\"op\">\n";
$content .= "</form>\n";
return $content;
}
function get_one_media($mms_date) {
global $path_to_media,$uplink;
$media_groups = array();
$dir = opendir("$uplink$path_to_media");
$files = readdir($dir);
$count=0;
$media_array = array();
$array_data = array();
while (false !== ($files = readdir($dir))) {
if(ereg("^($mms_date)([_])?([0-9]+)?\.(.*)$", $files, $array_data)) {
$media_array[$count] = "$array_data[1]:*:$array_data[2]:*:$array_data[3]:*:.$array_data[4]";
$count++;
}
}
closedir($dir);
$media_array_total = $count;
if($count == 0) {
$media_array[0] = "nothing";
}
$i = 0;
return $media_array;
}
function show_one_media($this_media_group,$media_time) {
global $password_protect_comments,$uplink,$time_offset;
global $path_to_media,$p,$prev_link,$next_link,$display_image_max_size_w,$display_image_max_size_h,$allow_comments,$max_count,$min_count,$pics_final_page_num,$realpage;
$datestamp = "";
$ii = 0;
$count = 0;
$middle_of_page = "";
$top_of_page = "";
while($ii < count($this_media_group)) {
$media_time_array = explode(":*:",$this_media_group[$ii]);
$media_underscore = $media_time_array[1];
$media_number = $media_time_array[2];
$media_ext = $media_time_array[3];
$hour_new = substr("$media_time", 8, 2);
$min_new = substr("$media_time", 10, 2);
$month_new = substr("$media_time", 4, 2);
$year_full = substr("$media_time", 0, 4);
$dayofmonth = substr("$media_time", 6, 2);
$dayofmonth++;
$dayofmonth--;
$month_new++;
$month_new--;
$unix_time = mktime ($hour_new,$min_new,0,$month_new,$dayofmonth,$year_full);
$unix_time = $unix_time + $time_offset;
$datestamp = strftime("%H:%M %a %b %d, %Y",$unix_time);
if($media_ext == ".txt") {
if(file_exists("$uplink$path_to_media$media_time$media_underscore$media_number$media_ext")) {
$media_text = file_get_contents("$uplink$path_to_media$media_time$media_underscore$media_number$media_ext");
$middle_of_page .= "\t<br>$media_text<br>\n";
}
}elseif(eregi("gif",$media_ext) OR eregi("jpg",$media_ext) OR eregi("png",$media_ext)) {
$middle_of_page .= "\n\t<br><a href=\"$uplink$path_to_media$media_time$media_underscore$media_number$media_ext\" target=\"_new\">\n";
$middle_of_page .= "<img src=\"".$uplink."phpThumb.php?src=$path_to_media$media_time$media_underscore$media_number$media_ext&w=$display_image_max_size_w&h=$display_image_max_size_h\" class=\"main_pic_frame\" alt=\"$media_time$media_ext\" title=\"click for full-sized pic! - $datestamp\"></a>\n";
}elseif($media_ext == ".3g2") {
$middle_of_page .= "\n\t<br>\n";
$middle_of_page .= make_video_param("$media_time$media_underscore$media_number");
}elseif($media_ext == ".mp3" or $media_ext == "mid") {
$middle_of_page .= "\n\t<br>\n";
$middle_of_page .= make_audio_param("$media_time$media_underscore$media_number", $media_ext);
}else {
$middle_of_page .= "\n\t<br><br><a href=\"$uplink$path_to_media$media_time$media_underscore$media_number$media_ext\">Click to play $media_ext file</a>\n";
}
$ii++;
$count++;
}
$top_of_page = "";
$top_of_page .= "<center>\n";
echo $top_of_page;
echo $middle_of_page;
echo "</center><br>\n";
}
function submit_comment($mms_date,$mms_comment,$user_value) {
global $uplink,$p;
global $mms_date,$gocomment,$user, $gocookiem, $campic,$path_to_media;
global $error;
$mms_comment = stripslashes($mms_comment);
$comment_date = time();
$mms_comment = eregi_replace("<", "<", $mms_comment);
if($user_value == "") {
$error = "Please type in a User Name!";
}elseif(strlen($user_value) > 20) {
$error = "User Name is too long. It must be 20 characters or less";
}
if($mms_comment == "") {
$error = "Please type in a Comment!";
}elseif(strlen($mms_comment) > 200) {
$error = "Comment is too long. It must be 200 characters or less";
}
if($error != "") {
head();
echo "<div class=\"main_pic\">\n";
echo "<br>$error<br><br>\n";
echo "<a href=\"javascript:history.back(-1)\">Go Back</a><br><br>\n";
echo "</div>\n";
foot();
die();
}
$ip_addr = $_SERVER['REMOTE_ADDR'];
global $path_to_media;
if(file_exists("$uplink$path_to_media".$mms_date."_comments.txt")) {
$mms_comments = file_get_contents("$uplink$path_to_media".$mms_date."_comments.txt");
$mms_comments = "$mms_comments<comment>$user_value<**>$mms_comment<**>$comment_date\n";
$filename = "$uplink$path_to_media".$mms_date."_comments.txt";
$file = fopen($filename, 'wb');
fwrite($file, $mms_comments);
fclose($file);
$index_comments = "index.php";
header("Location: $uplink$index_comments?p=$p&media=$mms_date");
die();
}else {
$mms_comments = "$user_value<**>$mms_comment<**>$comment_date\n";
$filename = "$uplink$path_to_media".$mms_date."_comments.txt";
$file = fopen($filename, 'wb');
fwrite($file, $mms_comments);
fclose($file);
$index_comments = "index.php";
header("Location: $uplink$index_comments?p=$p&media=$mms_date");
die();
}
}
function preview_comment($mms_date,$mms_comment,$user_value) {
global $uplink;
global $mms_date, $gocomment, $gouser, $campic, $gocookie, $P,$path_to_media;
$mms_comment = stripslashes($mms_comment);
if($user_value != "Humpa") {
$mms_comment = eregi_replace("<", "<", $mms_comment);
}
$mms_comment_show = nl2br($mms_comment);
$mms_comment_show = parseEmoticons($mms_comment_show);
$mms_comment_show = text_to_links($mms_comment_show);
//head();
echo "<center>\n";
//echo "<div class=\"title_pics\">Media</div><br>\n\n";
echo "<div class=\"preview_comment\" align=\"center\">\n";
$this_media_group = get_one_media($mms_date);
show_one_media($this_media_group, $mms_date);
echo "";
if($mms_comment != "") {
//echo "<div class=\"preview_comment\" id=\"preview_comment\">\n";
echo "\t<center>\n";
echo "Comment Preview<br>\n";
echo "<br>\n";
echo "\tPosted By $user_value\n\t</center>\n\t<HR noshade><br>\n";
echo "\t$mms_comment_show";
echo "\t<br>";
echo "\t<br>";
//echo "</div>\n";
echo "</center>\n";
}
echo "</div>\n";
echo "<br></center>\n";
show_comment_bar($mms_date,$mms_comment,$user_value);
echo "<br>\n";
show_comments($mms_date);
//foot();
}
function show_comments($mms_date) {
global $uplink;
global $path_to_media,$time_offset;
if(file_exists("$uplink$path_to_media".$mms_date."_comments.txt")) {
$mms_comments = file_get_contents("$uplink$path_to_media".$mms_date."_comments.txt");
$mms_comments_array = split("<comment>",$mms_comments);
$num_comments = count($mms_comments_array);
}else {
$num_comments = 0;
}
if($num_comments > 0) {
$i = 0;
$timenow = time();
echo "\t<br><br>\n";
echo "\t<table class=\"comment_table\" align=\"center\">\n";
echo "\t<tr>\n\t\t<td width=\"20%\" align=\"center\" class=\"comment_table_cell\">Name</td>\n\t\t<td width=\"67%\" align=\"center\" class=\"comment_table_cell\">";
echo "Comments</td>\n\t\t<td width=\"14%\" align=\"center\" class=\"comment_table_cell\">Date</td>\n";
echo "\t</tr>\n";
while ($i < $num_comments) {
list($mms_user_name,$comment,$comment_date) = explode("<**>", $mms_comments_array[$i]);
$mobile_comment_note = "";
$comment_date_words = date("g:ia M jS Y", $comment_date + $time_offset);
$comment_date_words = "<center>$comment_date_words</center>";
$comment = nl2br($comment);
$comment = parseEmoticons($comment);
echo "\t<tr>\n\t\t<td width=\"20%\" class=\"comment_table_cell\">$mms_user_name</td>\n\t\t<td width=\"67%\" class=\"comment_table_cell\">\n";
echo "\t\t\t$comment\n";
echo "\t\t</td>\n\t\t<td width=\"14%\" class=\"comment_table_cell\">$comment_date_words";
echo "</td>\n\t</tr>\n";
$i++;
}
echo "\t</table>\n";
}
}
function show_comment_bar ($mms_date,$mms_comment,$user_value) {
global $uplink,$p,$path_to_media;
global $user,$admin;
include("smilies_limited.php");
echo "\t<script language=\"JavaScript\" type=\"text/javascript\">\n";
echo "\t<!-- HIDING\n";
echo "\tfunction smiliewindowmedia()\n";
echo "\t{ \n";
echo "\twindow.open(\"".$uplink."smilies_all.php\", \"Smilies_All\", \"resizable=yes,menubar=0,location=0,toolbar=0,status=0,scrollbars=0,directories=0,width=335,height=520,top=0,left=0\"); \n";
echo "\t}\n";
echo "\t// END HIDING -->\n";
echo "\t</script>\n";
echo "\t<script language=\"Javascript\" type=\"text/javascript\">";
echo "\tfunction smiliemedia(thesmilie) {\n";
echo "\tdocument.commentformmedia.mms_comment.value += thesmilie+\" \";\n";
echo "\tdocument.commentformmedia.mms_comment.focus();\n";
echo "\t}</script>\n";
echo "\t<center>\n\t<b>Submit a Comment</b>\n";
echo "\t<table cellpadding=3>\n";
echo "\t<tr>\n";
echo "\t\t<td align=\"center\">\n";
echo "\t\t\t<FORM name=\"commentformmedia\" action=\"comments.php\" method=\"POST\">\n";
echo "\t\t\t<INPUT type=\"hidden\" value=\"$mms_date\" name=\"mms_date\">\n";
echo "\t\t\t<INPUT type=\"hidden\" value=\"$p\" name=\"p\">\n";
echo "\t\t\tUser Name: <INPUT type=\"text\" value=\"$user_value\" size=\"25\" name=\"user_value\"><br>\n";
echo "\t\t\t<TEXTAREA name=\"mms_comment\" ROWS=4 COLS=40>$mms_comment</TEXTAREA><br>\n";
echo "\t\t\t<INPUT type=\"submit\" name=\"c_op\" value=\"Preview\">\n";
echo "\t\t\t <INPUT type=\"submit\" name=\"c_op\" value=\"Submit\">\n";
echo "\t\t\t<br><br>\n\t\t<div class=\"comment_table\">\n\t\t\t<a href=\"javascript:smiliewindowmedia();\"><b>Show Smilies</b></a></div>\n\t\t\n";
echo "\t\t\t</FORM>\n";
echo "\t\t</td>\n\t</tr>\n\t</table>\n";
echo "\t</center>\n";
}
function parseEmoticons ($commenttext) {
global $uplink;
include("smilies.php");
//global $smiley1;
$emoticons = array();
foreach ($smiley1 as $i=>$sm) {
$emoticons[] = array("$i", "<img src=\"".$uplink."smilies/smilies_files/$sm\" alt=\"\" align=\"absmiddle\">");
}
foreach ($emoticons as $emoticon) {
$commenttext = str_replace($emoticon[0],$emoticon[1],$commenttext);
}
return $commenttext;
}
function text_to_links ($data) {
if(empty($data)) {
return $data;
}
$lines = explode("\n", $data);
while (list ($key, $line) = each ($lines)) {
$line = eregi_replace("([ \t]|^)www\.", " http://www.", $line);
$line = eregi_replace("([ \t]|^)ftp\.", " ftp://ftp.", $line);
$line = eregi_replace("( http://[^ )\r\n]+)", " <a href=\"\\1\" target=\"_blank\">click_here</a>", $line);
$line = eregi_replace("(https://[^ )\r\n]+)", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $line);
$line = eregi_replace("(ftp://[^ )\r\n]+)", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $line);
$line = eregi_replace("([-a-z0-9_]+(\.[_a-z0-9-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)+))", "<a href=\"mailto:\\1\">\\1</a>", $line);
if (empty($newText))
$newText = $line;
else
$newText .= "\n$line";
}
return $newText;
}
function make_audio_param($media_time, $media_ext) {
global $path_to_media,$uplink;
$content = "\t<object width=\"300\" height=\"42\">\n";
$content .= "\t<param name=\"src\" value=\"$uplink$path_to_media$media_time$media_ext\">\n";
$content .= "\t<param name=\"autoplay\" value=\"false\">\n";
$content .= "\t<param name=\"controller\" value=\"true\">\n";
// $content .= "\t<param name=\"bgcolor\" value=\"#FF9900\">\n";
$content .= "\t<embed src=\"$uplink$path_to_media$media_time$media_ext\" autostart=\"false\" loop=\"false\" width=\"300\" height=\"42\" controller=\"true\"></embed>\n";
$content .= "\t</object>\n";
return $content;
}
function make_video_param($media_time) {
global $path_to_media,$uplink,$video_ext;
$content = "\t<OBJECT CLASSID=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" WIDTH=\"176\" HEIGHT=\"160\" CODEBASE=\"http://www.apple.com/qtactivex/qtplugin.cab\"> \n";
$content .= "\t<PARAM name=\"SRC\" VALUE=\"$uplink$path_to_media$media_time$video_ext\"> \n";
$content .= "\t<PARAM name=\"AUTOPLAY\" VALUE=\"false\"> \n";
$content .= "\t<param NAME=\"type\" VALUE=\"video/quicktime\">\n";
$content .= "\t<PARAM name=\"CONTROLLER\" VALUE=\"true\"> \n";
$content .= "\t<EMBED SRC=\"$uplink$path_to_media$media_time$video_ext\" WIDTH=\"176\" HEIGHT=\"160\" ";
$content .= "\tAUTOPLAY=\"false\" CONTROLLER=\"true\" type=\"video/quicktime\" PLUGINSPAGE=\"http://www.apple.com/quicktime/download/\"> \n";
$content .= "\t</EMBED> \n";
$content .= "\t</OBJECT>\n";
return $content;
}
?> |
|
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Tue Jun 12, 2007 9:00 am Post subject: |
|
|
You will need to put your 3 lighthouse javascript files in a folder called js
Put that js folder in your humpa_mms folder (along with your folders for media, comments, delete, etc).
Also, you will need to create a new stylesheet and call it style_lighthouse.css |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|