PHP - Ip Board Hook Development (closing Feb 1th)
Hello fellow coders!
We are looking for an experienced developer to make a custom rating hook voor IP Board (invision Power).
We have a few requirements. One of them is that you are based in the EU (and under circumstances US based).
If this sounds interesting to you, please have a look at the requirements, some additional info and the application form here.
Thanks in advanced!
We aim to close the application period on February 1th.
Edited by cssfreakie2, 16 January 2015 - 03:36 PM. Similar TutorialsHi everyone,I want to learn PHP hook and I try hook examples.I tired this example but I saw only white page.It has a problem but I can't understand it Codes; hook.php <?php class Hooks { public function add($hook,$class=null,$method=null,$args=null) { if (empty($method)) error("You must include a method (function) when defining add_hook."); $this->hooks[$hook][]=array((!empty($class)?array($class,$method):$method),$args); return $this; } public function clear($hook=null) { if (!empty($hook)) unset($this->hooks[$hook]); else $this->hooks=null; } public function run($hook) { if (empty($this->hooks[$hook])) return $this; foreach ($this->hooks[$hook] as $hkey=>$hvalue) { if (is_array($hvalue[0])) $hvalue[0]=array($hvalue[0][0],$hvalue[0][1]); if (!empty($hvalue[1])) if (!is_array($hvalue[1])) call_user_func($hvalue[0],$hvalue[1]); else call_user_func_array($hvalue[0],$hvalue[1]); else call_user_func($hvalue[0]); } return $this; } } ?> script.php <?php // For a function: function doTitle() { echo $current->title; } $hooks->add('head_title',null,'doTitle'); // For a class: class Output { function body_final() { echo implode("\n",$this->body); } } $hooks->add('page_body','Output','body_final'); // To pass multiple arguments into a function, you must use: function test($arg1,$arg2) { echo "Arg1: {$arg1}, Arg2: {$arg2}"; } $hooks->add('page_body',null,'test',array('test','ing')); ?> index.php <?php // You must include the hook file here, or you can make an includes file to do all of your startup (as is normally done). include 'hook.php'; include 'script.php'; ?><!DOCTYPE html> <html> <head> <?php run('head_meta'); ?> <title><?php $hooks->run('head_title'); ?></title> <?php $hooks->run('head_links'); $hooks->run('head_scripts'); ?> </head> <body> <?php $hooks->run('page_body'); ?> </body> </html> Thank you This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=343204.0 Os I've developed a Message board. A user writes a message and then it appears on the message board. However When the user enters a message it isn't inserted into the MySql. Also when the messages are entered manually directly into the MySql table they dont show on the site. Can anyone see the problem. The code is in 3 php scripts. messageboard.php <?php ; session_start(); //this checks to see if the $_SESSION variable has been not set //or if the $_SESSION variable has been not set to true //and if one or the other is not set then the user gets //sent to the login page if (!isset($_SESSION['username'])) { header('Location: http://kaaleigh.byethost15.com/login.php'); } ?> <HTML> <head><title>Message Board - Logged In</title> <link rel='stylesheet' href='layout.css'> </head> <body bgcolor="#fd8ecf"> <center><img src="headerpage.jpg"></center> <div class="navbar"> <div class="button"><a href="index.html">Home</a></div> <div class="button"><a href="news.html">News</a></div> <div class="button"><a href="gallery.html">Gallery</a></div> <div class="button"><a href="videos.html">Videos</a></div> <div class="button"><a href="contact.html">Contact</a></div> <div class="button"><a href="links.html">Links</a></div> <div class="button"><a href="msg.html">Message Kaaleigh</a></div> </div> <div class="frame"> <frameset cols="25%,75%" noresize="noresize"> <?php session_start(); $username = $_SESSION['username']; $password = $_SESSION['password']; if(isset($_SESSION['username']) && isset($_SESSION['password'])) { echo " <b>Welcome ".$username." <br><br></b>"; } else { echo "Welcome Guest! <br> <a href=login.php>Login</a> | <a href=register.php>Register</a>"; } ?> <?php mysql_connect("****************", "**********", "*********"); mysql_select_db("**************"); ?> <form action="message.php" method="POST"> Your Name: <input type="text" name="author"><br> Message:<br><textarea cols="60" rows="5" name="message"></textarea><br> <input type="submit" value="Post Message"> </form> <hr> <?php // I am selecting everything from the messages section in the database and ordering them newest to oldest. $sql = mysql_query("SELECT * FROM messages ORDER BY posted DESC"); // Now I am getting my results and making them an array while($r = mysql_fetch_array($sql)) { $posted = date("jS M Y h:i",$r[posted]); // End of Array } ?> </body> </html> message.php <?php mysql_connect("*************", "*************", "**********"); mysql_select_db("**************"); $time = time(); mysql_query("INSERT INTO messages VALUES(NULL,'$_POST[message]','$_POST[author]','0','$time')"); echo "Message Posted.<br><a href='messageboard.php'>Return</a>"; msg.php <?php mysql_connect("********", "********", "*************"); mysql_select_db("**************"); echo "<a href='messageboard.php'>Go Back...</a>"; $sql = mysql_query("SELECT * FROM messages WHERE id = '$_GET[id]'"); // Now I am getting our results and making them an array while($r = mysql_fetch_array($sql)) { // Everything within the two curly brackets can read from the database using $r[] // I need to convert the UNIX Timestamp entered into the database for when a thread... // ... is posted into a readable date, using date(). $posted = date("jS M Y h:i",$r[posted]); // Now this shows the thread with a horizontal rule after it. echo "$r[message]<h4>Posted by $r[author] on $posted</h4><hr>"; // End of Array } Any thoughts? Hi, I am in the process of creating a discussion board. The have section in which someone can ask a question and add notes. However, I am slighlty stuck on the reply section. So I can display the question and notes. I was planning to add fields "Answer 1" then "Answer 2" then "Answer 3" etc. However, means I have to create upto 100 fields and create response boxes for each one. Does anyone know if there is a simpler way to do this? hi guys, the problem is, is that all of the code works fine, however im trying to post the user to the leader board (leaders.xml) however it just isnt adding to the xml page and im not too sure why. I attached all 3 files that you may need to see to figure it out. Hope you can really help, I would really appreciate it. Okay this section is the index where the user enters their user name Code: [Select] <?php session_name("elearning_Test"); session_start(); $_SESSION['score'] = 0; $_SESSION['correct'] = array(); $_SESSION['wrong'] = array(); $_SESSION['finished'] = 'no'; $_SESSION['num'] = 0; require_once ('functions.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Forensics E-learning Package</title> <script type="text/javascript" src="start.js"></script> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="wrapper"> <div id="header"> <div id="toplinks"> </div> </div> <div id="menu"> <ul> <li><a class="selected" href="home.html">Home</a></li> <li><a href="initialquiz.php">Initial Quiz</a></li> <li><a href="about.php">About</a></li> <li><a href="leaderboard.php">Leader Board</a></li> </ul> </div> <div id="content"> <div id="main"> <h1>Forensics E-Learning Package</h1><BR /> <h2>Start The Test</h2> <form id="questionBox" method="post" action="home.php"> <label for="username">Create A Username:</label><br /> <input type="text" id="username" name="username" value="Username" /> <p id="exp">Username must be between 3 and 10 characters in length</p></li> </ul> <p><input type="hidden" name="register" value="TRUE" /> <input type="submit" id="submit" value="Register And Take The Test" /></p> </form> <p id="helper"><?php if(isset($_SESSION['error'])) echo $_SESSION['error']; ?></p> </div> <div id="right"> <h2>Right Menu</h2> <div class="rightitem"> <ul> <li><a class="selected" href="home.html">Home</a></li> <li><a href="initialquiz.php">Initial Quiz</a></li> <li><a href="about.php">About</a></li> <li><a href="leaderboard.php">Leader Board</a></li> </ul> </div> </div> </div> <div class="clearbottom"></div> <div id="footer"> <p id="legal"> </p> </div> </div> </div> </body> </html> This section is the leaderboardpage Code: [Select] <?php session_name("elearning_Test"); session_start(); include_once('functions.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Forensics E-learning Package</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="wrapper"> <div id="header"> <div id="toplinks"> </div> </div> <div id="menu"> <ul> <li><a class="selected" href="index.php">Home</a></li> <li><a href="index.php">Initial Quiz</a></li> <li><a href="index.php">About</a></li> </ul> </div> <div id="content"> <div id="main"> <h1>Leader Board</h1> <h2>Top Scorers</h2> <?php echo "Welcome to the Leaderboard " . $_SESSION['user']; ?><BR /><BR /> <?php showLeaders('leaders.xml',20); ?><BR /><BR /> </div> <div id="right"> <h2>Right Menu</h2> <div class="rightitem"> <ul> <li><a class="selected" href="index.php">Home</a></li> <li><a href="index.php">Initial Quiz</a></li> <li><a href="index.php">About</a></li> </ul> </div> </div> </div> <div class="clearbottom"></div> <div id="footer"> <p id="legal"> </p> </div> </div> </div> </body> </html> And finally this section is the functions page. Code: [Select] <?php // shuffle answers function shuffle_assoc($array) { $keys = array_keys($array); shuffle($keys); $shuffled = array(); foreach ($keys as $key) $shuffled[$key] = $array[$key]; return $shuffled; } // leader board section function showLeaders($file,$limit,$group = null) { $leaders = array(); // Load the xml file and place all users and associated // scores into the 'leaders' array. $xml = simplexml_load_file($file); foreach($xml->user as $user) { $name = (string)$user->name; $score = (string)$user->score; $leaders[$name] = $score; } // Sort the leaders array numerically, highest scorers first. arsort($leaders,SORT_NUMERIC); // Initialise our $counter variable to '1'. $counter = 1; // Start a html ordered list to hold the leaders. $output = "<ul class=\"leaders\">\n"; // Loop through the 'leaders' array and wrap each username and score // in <li> tags. If the user is the current $_SESSION['user'], wrap // the name/score in <strong> tags too. foreach ($leaders as $key => $value) { // Check that $counter is less than $limit. if ($counter <= $limit) { if ($key == $_SESSION['user']) { $output .= "<li><strong>$key:</strong> $value/20</li>\n"; } else { $output .= "<li>$key: $value/20</li>\n"; } // Check to see if $group parameter has been passed. // If it has, create separate lists according to the $group variable. if ($group) { // Use the modulus operator(%) to create new sub-list. if($counter % $group == 0) { $output .= "</ul>\n<ul class=\"leaders\">\n"; } } } // Increment the $counter. $counter++; } // End the ordered list. $output .= "</ul>\n"; // Print out the ordered list. echo $output; } function showAnswers($answers,$questions) { for($x = 0; $x< count($answers); $x++) { if ($x % 2 == 0) { $output = "<div class=\"qanda clear\">\n"; } else { $output = "<div class=\"qanda\">"; } $output .= '<h4>Question' . ($x+1) . ': ' . $questions[$x] . '</h4>'; $output .= "<ol>\n"; for ($y = 0;$y< count($answers[$x]); $y++) { if (($answers[$x][$y] === $answers[$x][0]) && (in_array($answers[$x][$y],$_SESSION['correct']))) { $output .= "<li class=\"correctuser\">{$answers[$x][$y]} (Correct!)</li>\n"; } else if ($answers[$x][$y] === $answers[$x][0]) { $output .= "<li class=\"correct\">{$answers[$x][$y]}</li>\n"; } else if (in_array($answers[$x][$y],$_SESSION['wrong'])) { $output .= "<li class=\"wrong\">{$answers[$x][$y]} (Woops!)</li>\n"; } else { $output .= "<li>{$answers[$x][$y]}</li>\n"; } } $output .= "</ol></div>\n"; echo $output; } } ?> Thanks guys for your help. Just really need another pair of eyes on this as i cant see why. Lance Hi all, I'm very new to the wonderful world of php, so I'd appreciate any and all help in the matter. I've greatly simplified the code below to hopefully help you in helping me. Thanks! Ok, so I'm integrating a very simple message board feature into my site. The basic idea is that people post a comment, and have the option of replying to existing comments. I'm definitely not looking for a complete forum; just something that allows users to post and reply. I've tackled the posting bit easily enough. I have a form. Users fill in the form and the message, along with user information, is sent to a MySQL database. The information includes the username(Poster), the message(Message), an id that corresponds to the topic in question(Messid), a unique ID code for the message itself (ID), and a number of other variables like date and rank. I then use a while statement to bring up all of the messages that pertain to a particular topic; The output will only show messages that share the same Messid, and they are arranged in terms of descending ID: Code: [Select] <? while($row = mysql_fetch_array($resultcomments)) { $poster=$row['Poster']; $message= $row['Message']; $ID=$row['ID']; echo $message.$poster.$ID; } So far, so good. What I want is for users to be able to click on any one of the particular messages, and post a response comment that will appear directly below the message to which it responds. Any ideas how I might go about such a task? So far, I've created a new MySQL table that corresponds to these "subcomments". Each subcomment has a "subID" that corresponds to the ID of the message to which it responds. By including a while statement within the while statement above, I can successfully list all of the subcomments that correspond to a message directly below it. The problem, of course, is that I have to insert the subID values manually in php_my_admin. I'm hoping there's a way for php to automatically detect the ID value of the message in question... Many many thanks for any assistance I can get. Once this revolution in communication makes me a billionaire, I will be certain to reward you most properly. Thanks again. Right I want to make a request to my db to check the no. of rows it has. If it has changed, refresh the chat page. else wait. I have tried to check for last db update, that never worked as well. Well here is my code. Code: [Select] //this is my refresh script below $result = mysql_query("SELECT * FROM chatmessages"); $num_rows = mysql_num_rows($result); echo "$num_rows Rows\n"; while(0){ $num_rows_temp = mysql_num_rows($result); if ($num_rows != $num_rows_temp){ $$num_rows=$num_rows_temp; echo "<script>"; echo "window.location.replace('chatlog.php')"; echo "</script>"; }else{ sleep(2); } } I assume $num_rows != $num_rows_temp is wrong as it does not seem to do anything. Any help would be welcome. thanks. Sooo i got this idea but i dont know the line of code i should write +im an amateur coder. Anyone know how to make the 123d catch into a web application. Just gv me a start and ill modify the code slowly. And 1 more thing.. Does anybody know how 123d catch was able to combine the pictures into 3d. Like if you know can u also gv me the code.. appr3ciated alot. and also do u know how to make like if someone press the pic and moves to the left the 3d picture will move to the left also If any of you have developed mobile apps before I could really use some advice, please. I have never made one, and would like to for my website. I just need to query my database and display the information. From what I have been able to put together so far, I know that I can use css and jquery fine. My main question is: can I use php to query the mysql database? Pretty much I am a novice, so if using these languages together will not work, please feel free to suggest combinations that would be better. Although, I am trying to avoid as much object oriented stuff as I can, because I just don't get it entirely, but I'll still take the suggestion. Thanks. Hi, I'm not sure if this is the right place to post this but it seems to be acceptable. Please let me know if it's out of line, though. I recently started learning PHP and am going through PHP and MYSQL Web Development. It seems like a pretty good book so far. Currently I'm working through the code in chapter 1 and am running into an issue. From what I can tell, the code I should have at this point is as follows: <html> <head> <title>Bob's Auto Parts - Order Results</title> </head> <body> <h1>Bob's Auto Parts</h1> <h2>Order Results</h2> <?php // create short variable names $tireqty = $_POST('tireqty'); $oilqty = $_POST('oilqty'); $sparkqty = $_POST('sparkqty'); echo "<p>Order processed at "; echo date('H:i, jS F Y'); echo "</p>"; echo "<p>Your order is as follows: </p>"; echo $tireqty.' tires<br />'; echo $oilqty.' bottles of oil<br />'; echo $sparkqty.' spark plugs<br /'>'; ?> </body> </html> Within the PHP script, two particular blocks of code seem to be giving me problems: $tireqty = $_POST('tireqty'); $oilqty = $_POST('oilqty'); $sparkqty = $_POST('sparkqty'); and echo "<p>Your order is as follows: </p>"; echo $tireqty.' tires<br />'; echo $oilqty.' bottles of oil<br />'; echo $sparkqty.' spark plugs<br /'>'; Without these two blocks, the rest of the PHP executes but when I add one or both of these the PHP doesn't show up at all; instead it only executes the HTML and the output from the PHP doesn't show up. IF I remove these and only keep the "Order processed at" part of the script, that part executes fine. I've gone through the code in the book and it seems like what I have is correct. As soon as I try to define or call any of the variables, it seems to break the code. Any ideas? Sorry to bother you with such a basic question but I can't seem to locate a problem with this code based on what I've been taught so far. Thanks! Hi all, Php and web development wannabe, started HTML in about 2006 for my ebay listings, CSS came shortly after but it wasn't until maybe 2009 when I used my first 'someone-else's-php-script' to implement a dynamic breadcrumb. Although I have trouble reading volumes of text, a lot of discussions on code draw me in. I end up taking in a lot but in a totally non-structured way. After lots of googling, reading and some more practice of putting 'other-people's-php' into action I found I understood that breadcrumb... Sort of. I merrily tore out over half the code and refactored using ternary operators - I can't see why people remove those to increase readability?? OFC I lost every hint of error management! Now I've heard of error management I try to envisage what might go wrong and print messages to screen if "something unexpected happened". So I've been bumbling along solving problems for specific tasks and asking a lot of questions - But I've never joined a php forum! Formulating a question that's not embarrassing to ask, usually ends with me answering my own question and when I do want to put something out there, I'd rather fill up Yahoo Answers (A few very good and very generous users on there!) with my gibberish than contaminate someone's proper, serious, scripting forum. So anyway, I had a question to ask earlier, YA seems to be running out of steam and I only half answered it myself so here I am... Hi! Hi all. Does anyone use Localstack to for local AWS development? I'm currently developing on a system that uses numerous AWS SQS queues, AWS ElasticSearch, AWS Redis, and many, many S3 buckets with about three dozen PHP-based micro-services; I've built a local development environment consisting of containers using several Docker images, one of which mocks AWS using a Localstack image. This works, for the most part, but I find that the Localstack instance just ... stops working. It - after a random amount of time, and intermittently if more often than not - won't process any of the queues that the system uses, or will drop bucket contents despite being set up for persistence (the `DATA_DIR` objective is set to `/tmp/localstack/data` as instructed in the README). I get the impression that Localstack is fairly widely used for local AWS development, so I have to assume if this was a normal situation I'd've found it in my searching, but so far it doesn't seem to be a big deal. I'll post the docker-compose file here if it helps, but does anyone have any experience with a similar situation and feel like sharing tips? Did it work, did it not, do I need to convince my company to pay for the pro version, do I need to do a modified rain dance, etc? As always, thanks in advance for any thoughts or advice. Chrome? Edge? Other? Had a bad experience with Edge. If development tools make one better than the other - what tools? And if you are using PHPStorm maybe the choice of browser is less important? No? Edited June 26 by sen5241bThis topic has been moved to Editor Help (Dreamweaver, Zend, etc). http://www.phpfreaks.com/forums/index.php?topic=351013.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=349906.0 This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=347622.0 Hi,
I hope this belongs to the right sub-forum.
I'm gonna be on the move for quite some time, and I was wondering if there was an [almost] ideal portable PHP development environment, which I can treat just like the non-portable counterpart, which will include using Composer, Laravel, etc.
With a little research I found http://zwamp.sourceforge.net/ and http://www.codelobster.com, but I'm not sure how efficient they are.
Any of you guys use this approach?
Thanks.
HI All,
I need some suggestions on how to proceed on with component development. and any logic code or similar coding will be very much appreciated.
The component should display the list of contents displaying some columns from a table(ie.,scncontent) from database similar to web links component along with the tool bar (new,edit,publish,unpublish,trash etc., actions ) and with pagination also . This component should be designed with MVC architecture. On clicking new or edit icons, a form should be opened and data should be saved or updated to database.
Hey guys just thought I'd introduce myself as it's a polite thing to do.
My name is Nick I am currently a front end developer and love learning new technologies so it looks like PHP is my next step.
I hope to learn and give whatever knowledge I can back
Len M. Kaiser Web Design is a freelance custom web design firm specializing in web design & development including forums, shopping carts, content management systems, & blogs skins and maintenance. I follow the Wc3 standards for coding and make sure that the sites & skins I create are 100% XHTML compliant. I also create complete 100% table less designs for a web site and some skin depending upon the template structure that is already built in. Len M. Kaiser Web Design is an affordable North Charleston, SC based freelance web design firm that also serves clients all over the world. I specialize in web design, development, maintenance, & custom vBulletin related services such as vBulletin 3 & 4 styles (skins), installs, template coding, upgrades & maintenance. I have 8 years of experience in the freelance web design business & 15 years experience working with vBulletin forums and offer a hands on, individual approach with each and every client. I offer totally unique designs for your web site, forum, CMS, blog or e-Commerce site. I also have experience in various other PHP scripts such as XenForo, Wordpress, Joomla, OSCommerce, CubeCart, phpBB, Drupal, Magento, X-Cart and more! Check out My Services for a more in depth listing of what I can do for you and your business or hobby site. I offer free quotes for potential clients. Services I offer: 1. Custom web design & development 2. Custom forum skins such as vBulletin, XenForo, phpBB, MyBB, etc 3. Custom E-Commerce skins such as OSCommerce, X-Cart, Magento, CubeCart, ZenCart etc. 4. Custom CMS skins such as Joomla, Drupal, iScripts SocialWare etc. 5. Custom Blog skins such as Wordpress, Tumblr, Blogger etc. 6. Web site Maintenance including backups, web site moves, some hosting setups etc. 7. Installations & upgrades of any PHP script, plugin, component or software. Thanks, Len M. Kaiser http://lenmakiser.com |