Jump to content

HHawk

Members
  • Posts

    51
  • Joined

  • Last visited

    Never

Everything posted by HHawk

  1. Nevermind. Got fixed on another forum.
  2. The original creator of this small PHP script stopped working on it and I don't know much about PHP, so I need some help. Here is the script: <?php $fourcolor = 0; function pokerhand($text) { // Only take things that are between the tag. $ret = preg_replace("'<pokerhand>(\w*)</pokerhand>'e", "replace_card('\\1')", $text); return $ret; } function replace_card($text) { $ret = ""; $a = preg_split('//', $text, -1, PREG_SPLIT_NO_EMPTY); foreach($a as $value) { if(!strcmp($value, "c")) { $ret .= '<span class="clubs">♣ </span>';; } else if(!strcmp($value, "d")) { $ret .= '<span class="diamonds">♦ </span>'; } else if(!strcmp($value, "h")) { $ret .= '<span class="hearts">♥ </span>'; } else if(!strcmp($value, "s")) { $ret .= '<span class="spades">♠ </span>'; } else { $ret .= $value; } } return($ret); } function pokerhand_head() { global $fourcolor; $diamond = $fourcolor ? "blue" : "red"; $club = $fourcolor ? "green" : "black"; echo " <style type='text/css'> .diamonds { color: ".$diamond."; font-size: 15px; } .clubs { color: ".$club."; font-size: 15px; } .hearts { color: red; font-size: 15px; } .spades { color: black; font-size: 15px; } </style> "; } add_filter('the_content', 'pokerhand'); add_filter('the_excerpt', 'pokerhand'); add_filter('comment_text', 'pokerhand'); add_action('wp_head', 'pokerhand_head'); ?> As you can see it's a wordpress plugin script. The script itself works without problems, however it doesn't "color" the first number/graphic in front of the spade, diamond, heart or club. Sorry for my bad english, but I dunno how to describe it better. Maybe an example will help. Example When you use: <pokerhand>Js3h</pokerhand> It will show this: J♠ 3♥ But I want it to show like this: J♠ 3♥ As you can see, the number in front of the 3 is also colored red (of course the same goes for diamonds). And if possible, I want the output to be bold. Please help. Thanks!
  3. I have a question, I currently use 3 PHP scripts which all use their own database: phpBB3 / Tutorial script / Wallpaper php script (bought a license). Is it possible to merge / integrate (don't know the right word for it) the 3 databases into one. Meaning a user has to register only once, to use all 3 PHP scripts? Is this difficult to achieve? Note: this is a new website project for myself, so there are still no users whatsoever on any of the scripts (except for the admin of course).
  4. Unfortunately I still am having the problem. Once more: When I approve a picture / photo, the user get's an email (or notification) where it says their picture / photo has been approved. When I deny a picture / photo, the user does not get an email (or notification) that their picture / photo has been denied. Can someone please look at the code, maybe their is something wrong with it...
  5. I tried edited it, but all it gave me was a blank page... // send deny email here // SendUserEmail($goemail['email'],$DeclinePhotoEmailSubject,$reason_email); echo "<p>The email address is: "$goemail['email']"<br> The Subject is: "$DeclinePhotoEmailSubject"<br> The message is: "$reason_email;
  6. Sorry I do not fully understand you. I really lack PHP skills. :S Anyways, the delete works; image gets deleted.
  7. I am having some problems with photo script. When a user uploads a picture, it has to be moderated by an admin. The admin can choose to deny or allow the pictured to be visible for other users. When the admin chooses to allow the picture to be visible, the user receives an email where it says that his or her picture was approved and is visible online. This part of the script works! When the admin chooses to deny the picture to be visible, the user also receives an email, where it says that his or her picture was denied and a few possible reasons. And this part of the script does or will not work! The problem is, the picture is getting denied, it even says so in the user account (denied), however the person does not receive an email! I tried to correct it myself, but alas no go... And I don't know much about PHP, most of the time I can fix things by looking at another part, but not this time. So please help me out! Here is the script: <?php session_start(); require("../config.php"); require("adminglobal.php"); $AdminInfo =& new Admin(); if (!$AdminInfo->VerifyAdminSession()){ header("location: index.php"); } include("../templates/admin/adminheader.html.php"); echo "</head> <body onload=\"FullScreen_go();\"> <div>"; if (isset($_POST["action"]) AND isset($_POST["action"]) == "save"){ $Deleted = 0; $Denied = 0; $Approved = 0; while (list($key, $index) = each ($_POST["approve_"])){ $getemail = mysql_query("select id,userid,email from $usr_tbl where id = '{$_POST["user_"][$index]}'"); $goemail = mysql_fetch_array($getemail); if ($index == "delete"){ //echo "key= ". $key ."index = ". $index; mysql_query("delete from $pic_tbl where picid = '{$key}'"); $Deleted++; if ($Deleted >1){ $DeletedResults = "($Deleted) Photos Have Been Deleted<br />"; } else { $DeletedResults = "($Deleted) Photo Has Been Deleted<br />"; } } elseif ($index == "deny"){// start deny email $Denied++; if ($Denied >1){ $DenyResults = "($Denied) Photos Have Been Denied<br />"; } else { $DenyResults = "($Denied) Photo Has Been Denied<br />"; } $reason_email = ereg_replace("(\r\n|\n|\r)", "<br />", $_POST["reason"][$key]); mysql_query("update $pic_tbl set status = '5' where picid = '{$key}'"); // send deny email here SendUserEmail($goemail['email'],$DeclinePhotoEmailSubject,$reason_email); } else { $Approved++; if ($Approved > 1){ $ApproveResults = "($Approved) Photos Have Been Approved<br />"; } else { $ApproveResults = "($Approved) Photo Has Been Approved<br />"; } $SignupEmail = str_replace("{PIC}", $_POST['pic'][$key],$GrantedPhotoEmail); $SignupEmail = str_replace("{PICID}", $key,$SignupEmail); $SignupEmail = str_replace("{NAME}", $goemail['userid'],$SignupEmail); SendUserEmail($goemail['email'],$GrantedPhotoEmailSubject,$SignupEmail); $sitedate = $_POST['siteyear'][$key]."-".$_POST['sitemonth'][$key]."-".$_POST['siteday'][$key]." ".date('G').":".date('i').":".date('s'); $sitedate = strtotime($sitedate); mysql_query("update $pic_tbl set picture='{$_POST['pic'][$key]}', dateadded = '$sitedate',ncat='{$_POST['category_wanted'][$key]}', status='1',admincomment = '{$_POST["comment_"][$key]}' where picid = '{$key}'") or die("update error: ".mysql_error()); } } if ($Approved > 1 or $Deleted >1 or $Denied >1){ $exs = "s"; } $header = "Approved Photo$exs"; include("../templates/admin/header.html.php"); echo "<div class=\"error\">$DeletedResults $DenyResults $ApproveResults</div>"; exit; } $header = "All Pending Photos"; include("../templates/admin/header.html.php"); $sql_select = "select * from $pic_tbl,$usr_tbl where pic_userid=id AND $pic_tbl.status='2' order by picid ASC $limitq"; $sql_select2 = "select picid from $pic_tbl,$usr_tbl where pic_userid=id AND $pic_tbl.status='2'"; $sql_links = mysql_query ($sql_select) or DIE(mysql_error()); //echo $sql_select; $sql_links2 = mysql_query($sql_select2) or DIE(mysql_error()); $num_links = mysql_num_rows($sql_links); // sets offset to we can se how many rows are returned if (empty($_GET["ofs"])){ $all_links = mysql_num_rows($sql_links2); $_SESSION['all_links'] = $all_links; } $firstrowonpage = $_GET["ofs"] + 1; $nav = admin_page_num("photopending.php",$_GET['action'], $all_links, $admin_member_per_page, $pagenum, $_GET['ofs'],$sitecatid,$mainorder,'',$sortby); $totalpages = intval($all_links / $admin_member_per_page); if ($all_links%$admin_member_per_page) { // has remainder so add one page $totalpages++; } if ($num_links){ $pitems = ''; echo " <form action=\"photopending.php\" method=\"post\">\n"; for ($i=0; $i<$num_links; $i++){ $row = mysql_fetch_array($sql_links); $size = GetNewImageSize($row['picture']); $picture = $siteurl."/thumbnailer.php?p=".$row['picture']."&w=$size[0]&h=$size[1]"; // gets the time it was added $date = date('Y-m-d', $row['dateadded']); $joindate = explode("-", $date); $sitedate = "<select name=\"siteyear[{$row['picid']}]\">\n"; $sitedate .= " <option value=\"\">-------</option>\n"; for($x=2002; $x<2015; $x++){ $selected = ($joindate[0] == $x)?"selected=\"selected\"":""; $sitedate .= " <option value=\"$x\" $selected>$x</option>\n"; } $sitedate .= " </select> - \n"; $sitedate .= " <select name=\"sitemonth[{$row['picid']}]\">\n"; $sitedate .= " <option value=\"\">-------</option>\n"; for ($y=01; $y<13; $y++){ $selected = ($joindate[1] == $y)?"selected=\"selected\"":""; $sitedate .= " <option value=\"$y\" $selected>$y</option>\n"; } $sitedate .= " </select> - \n"; $sitedate .= " <select name=\"siteday[{$row['picid']}]\">\n"; $sitedate .= " <option value=\"\">-------</option>\n"; for ($z=01; $z<32; $z++){ $selected = ($joindate[2] == $z)?"selected=\"selected\"":""; $sitedate .= " <option value=\"$z\" $selected>$z</option>\n"; } $sitedate .= " </select>"; $color = ($color == "#ededed")?"#D9D9D9":"#ededed"; $DeclineEmail = str_replace("<br />","\r\n", $DeclinePhotoEmail); $DeclineEmail = str_replace("{NAME}",$row['userid'], $DeclineEmail); include("list_admin3.php"); eval("\$pitems .= \"".gettemplate("templates/admin/pending_item")."\";"); } echo $pitems; echo " <table width=\"100%\"><tr>\n"; echo " <td align=\"center\" >"; echo " <input type=\"hidden\" name=\"action\" value=\"save\">\n"; echo " <input type=\"submit\" name=\"send\" value=\"Approve Checked\">\n"; echo " <input type=\"reset\" name=\"reset\" value=\"Reset Form\">\n"; echo " </td>"; echo " </tr></table></form>"; } else { echo"<div class=\"error\">$NoItemsToDisplay</div>"; } include("../templates/admin/pagenumber.html.php"); echo"</table>\n"; include("../templates/admin/adminfooter.html.php"); ?> Can someone take a look at it, maybe I missed something? Thanks in advance. Regards, HHawk
  8. Uhmz... I understand what you mean, though I have to make some changes to the CSS.
  9. Ah okay, thanks. I will look into it.
  10. Thanks for your answer, but I use borders. Meaning if I use that and clients don't select all the options (e.g. just one) you get several lines, which makes it look thick. Dunno how to explain correctly. Any other ideas by any chance?
  11. <table> <tr> <td class="pblabelcell">:: te installeren opties op uw server :: </td> </tr> <tr> <td class="plabelcell"><br> [m_4PSA_Software1]<br> [m_4PSA_Software2]<br> [m_4PSA_Software7]<br> [m_4PSA_Software]<br> [m_4PSA_Software3]<br> [m_4PSA_Software4]<br> [m_4PSA_Software5]<br> [m_4PSA_Software6]<br> [m_Plesk_add-on]<br> <br></td> </tr> </table> Doubt it will be helpful though... /edit Removing the breaks is no option, cause it will make it look awful (worse then it is now).
  12. I seem to have a (small) problem with my form's output. One part of my form consists out of several options with a checkbox, e.g.: I want the following software installed: [] brand a [] brand b [] brand c [] brand d [] brand e When people select all for of the checkboxes, the form's output looks fine. But when people check options b & d (for example) they get an ugly space in between when they go to the overview page. They get this (empty space) [] brand b (empty space) [] brand d (empty space) Is there any way to remove those empty spaces? I already tried Googling it several times, but no results... Any advice?
  13. For some odd reason, I cannot get the lines perfect inside my order form. While it looks perfect in Internet Explorer 7, Mozilla Firefox ruins it for some reason. It's not a life threatening situation, but I want it to look perfect. Take a look at the following 2 screenshots. http://www.mvdl.info/csshelp/ie7.jpg Look at the lines next to the red line and you will notice it lines up beneath each other perfectly. http://www.mvdl.info/csshelp/firefox.jpg As you can see, in Firefox it does not align perfectly. Changing the size of the box e.g. with 1 px ruins it for both browsers. So I am pretty clueless on what to do here. Here is the CSS code which is used for the form, or at least the part which is relevant. .slabeltop { font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; color: #3670A7; background-color: #F2F7FB; text-align: center; margin-right: 5px; padding-right: 5px; height: 25px; } .slabelcell { font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; color: #3670A7; background-color: transparent; width: 100px; } .sfieldcell { font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; color: #3670A7; background-color: #F2F7FB; text-align: right; margin-right: 5px; padding-right: 5px; width: 360px; height: 30px; } .sradiocell { font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; color: #3670A7; background-color: #F2F7FB; text-align: right; margin-right: 5px; padding-right: 5px; width: 20px; height: 30px; } .sqmcell { font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; color: #3670A7; background-color: transparent; text-align: center; width: 20px; } .dlabelcell { font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; color: #3670A7; background-color: transparent; width: 100px; } .dfieldcell { font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; color: #3670A7; background-color: #F2F7FB; text-align: right; margin-right: 5px; padding-right: 5px; width: 381px; height: 30px; } .dfieldcell input { width: 175px; font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; background-color: #D7E5F2; color: #102132; border: 1px solid #284279; margin-right: 5px; text-align: right; } .dfieldcell select { font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; background-color: #D7E5F2; color: #102132; border: 1px solid #284279; margin-right: 5px; padding-right: 0px; } .d2fieldcell { font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; color: #3670A7; background-color: #F2F7FB; text-align: right; margin-right: 5px; padding-right: 5px; width: 381px; height: 30px; } .dqmcell { font: 10px Verdana, Geneva, Arial, Helvetica, sans-serif; color: #3670A7; background-color: transparent; text-align: center; width: 20px; } .s is for the top 2 boxes .d is for the last box... Hope anyone has the solution for me, cause this is driving me nuts. :S
  14. Yeah well hiring someone is at the moment not an option. Cause we will have multiple order forms, which we have to customize ourselves on a regular basis. When we hire someone to do this, we will have to ask him / her over and over again for the simplest things. Also we have to wait every time when this person has the time. Since we are a webhosting company we want to be able to make changes ourselves 24/7 when needed. So if anyone can recommend a good script, we would highly appreciate it.
  15. Hi guys, I am having some serious difficulties in finding a good PHP script which processes an online order form. I have bought 2 scripts already, but simply they didn't provide what I want them to do... Therefor I come here to ask some advice where I can find a really good script free or paid, I don't care really as long as it works. Maybe some of you have good experience with a script? I have purchased and tried the following two: Allibsus Mail Pro (bad support and therefor asked a refund) and Form Maker Pro from Mitridat. I still use the last one, since we bought it some months ago already. Though it's adequate it does have some problems. So if anyone can recommend me a good PHP form script, I would be grateful. I already did several searches on www.hotscripts.com but I really don't know which one is good and which one is "bad". I have a few things I really want / need in the form; 1. Multiple page form (instead of one long form). This looks way more professional imho. 2. Easy to integrate in our current website's layout which uses $_GET superglobals to call pages within the website. Thanks for reading my posting.
  16. Well it's just a simple html form... Don't know if that information matters?
  17. Hi there, I have a question regarding forms. Currently we receive forms from our website, which is great and stuff, but there a lot of empty fields on our forms (since they are not all required to be filled in). Is there a way to remove the empty fields completely before the form in sent by email? So we get a cleaner order form by email? Please advice and thanks in advance.
  18. I was searching for a PHP script which is able to show a traceroute from our server to various locations. Apparently, there are not many out there. :S Anyways I did find one out there, though very simple, it does (sorta) what I want it to do. Except for one thing... Instead of entering an IP manually, I want a pulldown menu with like 10 addresses e.g. telia.net (for Sweden), etc. Is this easy to change with the following code? (it's just one file) [code] !DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html> <head> <title>The WorldsEnd.NET - Free Traceroute Script, written in PHP</title> </head> <?php //  This script was writen by webmaster@theworldsend.net, Aug.2001 //  http://www.theworldsend.net //  This is my first script. Enjoy. //  // Put it into whatever directory and call it. That's all. // Updated to 4.2 code in 2002 // Get Variable from form via register globals on/off //------------------------- $unix      =  1; //set this to 1 if you are on a *unix system      $windows  =  0; //set this to 1 if you are on a windows system // ------------------------- // nothing more to be done. // ------------------------- //globals on or off ? $register_globals = (bool) ini_get('register_gobals'); $system = ini_get('system'); $unix = (bool) $unix; $win  = (bool)  $windows; // If ($register_globals) {   $ip = getenv(REMOTE_ADDR);   $self = $PHP_SELF; } else {   $submit = $_GET['submit'];   $host  = $_GET['host'];   $ip    = $_SERVER['REMOTE_ADDR'];   $self  = $_SERVER['PHP_SELF']; }; // form submitted ? If ($submit == "Traceroute!") {       // replace bad chars       $host= preg_replace ("/[^A-Za-z0-9.]/","",$host);       echo '<body bgcolor="#FFFFFF" text="#000000"></body>';       echo("Trace Output:<br>");       echo '<pre>';                //check target IP or domain       if ($unix)       {         system ("traceroute $host");         system("killall -q traceroute");// kill all traceroute processes in case there are some stalled ones or use echo 'traceroute' to execute without shell       }       else       {         system("tracert $host");       }       echo '</pre>';       echo 'done ...';  } else {     echo '<body bgcolor="#FFFFFF" text="#000000"></body>';     echo '<p><font size="2">Your IP is: '.$ip.'</font></p>';     echo '<form methode="post" action="'.$self.'">';     echo '  Enter IP or Host <input type="text" name="host" value="'.$ip.'"></input>';     echo '  <input type="submit" name="submit" value="Traceroute!"></input>';     echo '</form>';     echo '<br><b>'.$system.'</b>';     echo '</body></html>'; } ?> [/code] Or if anyone knows a better script, then please tell... Thanks.
  19. I will sent you a PM later on... Have to do something else first. But thanks in advance. :)
  20. Uhm... Okay the error seems permanent for some reason. I deleted the old MySQL database, then created a new one. Copied everything to the faq dir (from the zip), edited the config.php correctly to the new values, but I still get the same error mentioned above. :S I appreciate your help, but it looks like this will never work. :S If you know of a better FAQ or Knowledgebase, which will work better within my website, please tell. It does not have to be very special. Just a Q & A which uses the MySQL db and the ability to add and delete stuff. That's all. That's the main reason I picked this FAQ for starters. I thought it would be "easy" to integrate within my website... :(
  21. Weird... I made a backup of my current FAQ. Next I unpacked your zip to a local folder. Transfered everything, edited the config.php, but I am getting the following error; [code] Warning: mysql_connect(): Access denied for user 'apache'@'localhost' (using password: NO) in /var/www/vhosts/directhosting.nl/httpdocs/carpediem/config.php on line 45 Warning: mysql_select_db(): Access denied for user 'apache'@'localhost' (using password: NO) in /var/www/vhosts/directhosting.nl/httpdocs/carpediem/config.php on line 46 Warning: mysql_select_db(): A link to the server could not be established in /var/www/vhosts/directhosting.nl/httpdocs/carpediem/config.php on line 46 Unable to select database [/code] But the config file seems okay to me... /edit Nevermind, something is wrong I guess, cause it's happening with the backup as well... ...looking into it.
  22. Awesome... Thanks for your help so far! I appreciate it. :) If you need any more files or anything please do not hesitate to ask!
×
×
  • 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.