Jump to content

workbench

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

workbench's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I dont know if this is the correct forum to post in...but, I just set up a Myspace Clone for a client and was wondering what the best option is for hosting it. Currently she's using a basic Ipowerweb plan, and since its shared with about 700 other people, it sucks. The database is down on average, 2-5 hours every couple days, which as you can imagine shuts down the entire site for that time.  Which makes her extremely unhappy. There is the option of moving to a VPS on Ipowerweb, but she's hesitant to go that route seeing as the customer service has been horrible thus far and she seems to think that the downtime she's experience has little to do with her current hosting plan and more to do with Ipowerweb. So, My question is...will moving to a VPS alleviate these problems?  Have any of you had a previous experiences?  A dedicated server is too cost prohibitive, so thats out of the question.  But on the other hand she's not looking for a bang for her buck alternative either.  She's willing to spend between $50-75 a month for piece of mind. Any suggestions?  Please.  Any response would be greatly appreciated... Thanks
  2. I actually am using nl2br() to create the line breaks, and then preg_replace to remove the <br>.  $row_f->f_matt = nl2br(preg_replace("<br>","",$row_f->f_matt)); but the preg_replace command I'm using just removes the br and leaves the <> in the output. I'm stumped..
  3. I'm pretty new to php so please be forgiving... I've created a forum with a text field.  Users can input text and when they hit "return"  just like I'm doing now... they see the returns in there text box(like I see in this one).  However once the post is made the line breaks are gone and instead output <br> tags.  For example, If I typed: ------------- test test ------------- The output would be: ------------------- test <br> <br> test ------------------- I've managed to get rid of the "br" and insert the correct line break using the following code: [code] <tr> <td class="body"><font color="#666666" size="2">   <? $row_f->f_matt = nl2br(preg_replace("<br>","",$row_f->f_matt));         echo stripslashes($row_f->f_matt);         if($row_f->edited!=0)         echo "</font><br><br><i>Post edited by moderator at ".date("j-m-YH:i:s",$row_f->edited)."</i>";     ?> </td> </tr> [/code] However this does not remove the carrots.  So the output from above is now: --------- test <> <>test --------- Anyone know how to get rid of the <>'s? This is driving me nuts..Any help ould be appreciated..
  4. On a side note, I feel like the Admin Area is to blame because almost everything I do using the Admin Section ends up in disaster.  When I deleted all the catagories and added my own,  It caused the classified section to die. It assigned all the "main categories" with a cat_id tag incrementing by 1000.  But then Assigned all the subcategories sub_cat_id tags incrementing by 1.  Meaning that the category and subcategory of For Sale ->Cars was created in the MySql Database as: For Sale=1000 Cars=1 When It should have been For Sale=1000 Cars=1001 I had 25 categories with about 200 sub categories and everytime you clicked on a subcategory...ERROR I had to manually go into mysql database and add the prefixes to fix it...... Whoever made this product blows...and support is nonexistent..
  5. You know what? I'm such a newbie I dont even know how to do a simple echo command.  All I know is I've seen it about 1000 times on the 50 php pages for this site. Here's the thing... I believe the code I posted is supposed to execute a search and return the result..Right? Well, There are about 10 different search engines in the site.  Search for people, groups, tribes, forum posts, etc,etc,....All of them work fine except for this one. Personally, seeing as the "admin area" of the site sucks, I have a feeling that when I deleted ALL the catagories from the classified section, and added my own(Using the janky Admin Area), somehow the table structure was modified and thats why I'm getting the error.  Is this possible?
  6. Ok, so I'm kind of new to php.  I'm building a myspace type community for a friend using Alstrasoft e-friends.  Basically, the software blows.  Straight out of the box it had so many bugs, it took hours to get it running. Anyway, there is a "classifieds" section where you can browse by category & subcategory(similar to craigslist) and run searches.  When I loaded up the software for the first time everything worked fine, you could post ads and run searches & everything was peachy. Last night, I went into the "admin" section, and deleted all the categories and subcategories and added my own.  Now, when I try to run a search I get the following message: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/bakespac/public_html/friends/functions.php on line 28 Here's the source: function sql_execute($sql_query,$wtr){ global $conn_id; $sql_res=mysql_query($sql_query,$conn_id); if($wtr=='get'){ if(mysql_num_rows($sql_res)){ return mysql_fetch_object($sql_res); } else { return ''; } } elseif($wtr=='num'){ return mysql_num_rows($sql_res);    -------------------------------->Line 28 } elseif($wtr=='res'){ return $sql_res; } } Anyone have any ideas what the hell is going on here?
  7. Well, the test is "can I put in an email address without a comma at the begining.  If I remove or alter this line $email=",".$email; Nothing appears to change at all. If I remove both those lines then I get "Please fill in required fields"  regardless of whether I have a comma or not. However If I remove the second line only: I get this error.. Warning: Invalid argument supplied for foreach() in /home/bakespac/public_html/friends/functions.php on line 567 Where we find this: //deleting empty values of array function if_empty($data){ $flag=0; if($data==''){   return ''; }//if else{ $result=array(); $i=0; foreach($data as $val){                    -------------------------->Line 567   if((isset($val))&($i!=0)&($val!="")){ //if(!$val){     $flag=1;     array_push($result,$val);   }//if $i++; }//foreach if($flag==0){   return ''; }//elseif else {   return $result; }//else }//else }//function function if_empty1($data){ $flag=0; if($data==''){   return ''; }//if else{ $result=array(); $i=0; foreach($data as $val){   if($val){ //if(!$val){     $flag=1;     array_push($result,$val);   }//if $i++; }//foreach if($flag==0){   return ''; }//elseif else {   return $result; }//else }//else }//function ???
  8. I've tried both those and it does nothing....I'm scouring the code for anything...This is killing me!!! ???
  9. It is a "tell a friend" code.  I'm using the Alstrasoft E-friends software.  It suck big time.  There are so many bugs its insane.  It is the "Invite a friend" a friend page, where your supposed to be able to send an email message to someone inviting them to join the site. I cannot for the life of me figure out why this refuses to work.  Like I said previously, it will only send an email if there is a comma in front of the email address.  So, if you fill in the field with one email address it will come back with a "please fill in required fields" error. And if you put in 3 email addresses, it will send all except for the 1st one(because the other two have commas in front of them).  What the hell!!!!
  10. Just in case that wasn't enough...here's more of the source code...   //getting values   $emails=form_get("emails");   $subject=form_get("subject");   $mes=form_get("mes");   $emails=ereg_replace("\r","",$emails);   $emails=ereg_replace("\n","",$emails);   $emails=ereg_replace(" ","",$emails);   $email=",".$email;   $email=split(",",$emails);   $email=if_empty($email);   $data[0]=$subject;   $now=time();   if($email!=''){   show_header();   echo "<table width=100% class='body'>   <tr><td class='lined title'>Invitation</td>   <tr><td class='lined'>";   foreach($email as $addr){   //if user is site member - standart invitation       $sql_query2="select mem_id from members where email='$addr'";       $num=sql_execute($sql_query2,'num');       if($num!=0){       $fr=sql_execute($sql_query2,'get');       $sql_query="select mem_id from network where mem_id='$m_id' and frd_id='$fr->mem_id'";       $num2=sql_execute($sql_query,'num');       $sql_query="select mes_id from messages_system where       (mem_id='$m_id' and frm_id='$fr->mem_id' and type='friend') or       (mem_id='$fr->mem_id' and frm_id='$m_id' and type='friend')";       $num=sql_execute($sql_query,'num');   if($m_id==$fr->mem_id){     echo "$addr: you can't invite yourself!</br>";   }//if   elseif($num>0){     echo "$addr - you already invited this user.</br>";   }//elseif   elseif($num2>0){     echo "$addr - this user is already your friend.</br>";   }//elseif   else {       $subj="Invitation to Join ".name_header($m_id,$fr->mem_id)."\'s Personal Network";       $bod="After you push \"Confirm\" button user ".name_header($m_id,$fr->mem_id).       " will be added to your friends network.";       $sql_query="insert into messages_system(mem_id,frm_id,subject,body,type,folder,date)         values('$fr->mem_id','$m_id','$subj','$bod','friend','inbox','$now')";         sql_execute($sql_query,'');         echo "$addr: Invitation is sent.</br>";   }//else       }//if a user       else {       //if user is not site member - just sending email       $sql_query="insert into invitations (mem_id,email,date) values ('$m_id','$addr','$now')";       sql_execute($sql_query,'');       $sql_query="select max(inv_id) as maxid from invitations";       $max=sql_execute($sql_query,'get');       $data[1]=$mes."       <a href='$main_url'>$main_url</a></br>       <a href='$main_url/index.php?mode=join&inv_id=$max->maxid'>$main_url/index.php?mode=join&inv_id=$max->maxid</a>";       $data[2]=name_header($m_id,"ad");       $sql_query="select email from members where mem_id='$m_id'";       $k=sql_execute($sql_query,'get');       $data[3]=$k->email;       messages($addr,"6",$data);       echo "$addr: Invitation is sent.</br>";       }//else   }//foreach   echo "</td></table>";   }//if   else {       error_screen(3);   }//else }//else }//function
  11. So, I dont know very much about php. Most projects I work on require simple mods of existing scripts, and I can usually figure out(with enough hours) how to fix glitches, bugs etc.  This however is driving me crazy. I'm setting up a "MySpace" type site for a client.  I've had a pretty gnarly crash course so far and have learned a lot.  However this one thing is killing me.  Anyway, there is a section on the site where you can invite members from outside the community to join.  You can add as many email address as you like and it will outsend invitation to the recipients.  The emails are separated with commas. Now heres the glitch. If you try to input a single email address, it gives an error message.  Or, If you have more than one address(say 10), only the ones AFTER the first comma(the last 9) will be sent.  The only way to send ONE email address is by typing it in with a comma preceding it, like ",mike@jones.com".  Ive scoured the code and think this is the script handling the emailing....Anyone have any ideas how I can fix it? $emails=form_get("emails");   $subject=form_get("subject");   $mes=form_get("mes");   $emails=ereg_replace("\r","",$emails);   $emails=ereg_replace("\n","",$emails);   $emails=ereg_replace(" ","",$emails);   $email=",".$email;   $email=split(",",$emails);   $email=if_empty($email);   $data[0]=$subject;   $now=time();   if($email!=''){   show_header();   echo "<table width=100% class='body'>   <tr><td class='lined title'>Invitation</td>   <tr><td class='lined'>"; Any help would be sooooooo appreciated..
×
×
  • 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.