Jump to content

HHawk

Members
  • Posts

    51
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

HHawk's Achievements

Member

Member (2/5)

0

Reputation

  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?
×
×
  • 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.