PHP - Help: Adding A Carousel/featured Content Thesis Blog
I have installed the Carousel code using tutorial at http://www.wolf-howl.com/blogs/how-to-carousel/
now i amfacing a problem that every thing is working expect images thumbnail. here is the site http://www.digpk.com/ where i am try to make carousel. you can see the featured posts at top with missing thumbnails. Thanks in advance. picture of the problem is also attached. Similar TutorialsI've been working on developing a CMS blog and now I'm trying to create a slideshow wit Bootstrap Carousel on the homepage to present the dynamic content (images + text) using the data from table 'posts'. I tested this code, and it only presents one post. I mean, It's not possible to go to the next slide. I want to show all the posts on the slides. *The DB connection is already on the includes. The connection was written on a small file called DB.php Home.php <header> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li> <li data-target="#carouselExampleIndicators" data-slide-to="1"></li> <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> </ol> <div class="carousel-inner" role="listbox"> <?php // The default SQL query $sql = "SELECT * FROM posts ORDER BY id desc"; $stmt = $ConnectingDB->query($sql); while ($DataRows = $stmt->fetch()) { $Id = $DataRows["id"]; $PostTitle = $DataRows["title"]; $Image = $DataRows["image"]; $PostText = $DataRows["post"]; ?> <!-- Slide --> <div class="carousel-item active" style="background-image: url('uploads/<?php echo $Image; ?>')"> <div class="carousel-caption"> <div class="card-body black"> <h3 class="large-mistral-white"><?php echo $PostTitle; ?></h3> <p class="small-times-white"><?php echo $PostText; ?></p> </div> </div> </div> <?php } ?> </div> <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </header> DB.php <?php $DSN='mysql:host = localhost; dbname=everybody_blog'; $ConnectingDB = new PDO($DSN,'root',''); ?>
Hi, I have some code which displays my blog post in a foreach loop, and I want to add some social sharing code(FB like button, share on Twitter etc.), but the problem is the way I have my code now, creates 3 instances of the sharing buttons, but if you like one post, all three are liked and any thing you do affects all of the blog post. How can I fix this? <?php include ("includes/includes.php"); $blogPosts = GetBlogPosts(); foreach ($blogPosts as $post) { echo "<div class='post'>"; echo "<h2>" . $post->title . "</h2>"; echo "<p class='postnote'>" . $post->post . "</p"; echo "<span class='footer'>Posted By: " . $post->author . "</span>"; echo "<span class='footer'>Posted On: " . $post->datePosted . "</span>"; echo "<span class='footer'>Tags: " . $post->tags . "</span>"; echo ' <div class="addthis_toolbox addthis_default_style "> <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> <a class="addthis_button_tweet"></a> <a class="addthis_counter addthis_pill_style"></a> </div> <script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=webguync"></script>'; echo "</div>"; } ?> This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=323879.0 Hi All, I'm new to PHP and felt that if anyone can help me out it would be someone of the PHPfreaks community. I've used the "easyphpcalendar" in my site, www.imagenenation.ca and my client has requested that the "list mode" (white section of the homepage) only have one event listed at a time. This i can do. The other part of their request is to have that one event be pulled from a list of events posted during that calendar month. So I'm looking for a PHP string of code that will echo a random event to be posted to the single "list mode" area, from a group of postings for a day that may have up to six postings. The code currently used for this "list mode" is; <?php $LIST=1; $DF = "D - M d"; $noOld = 1; $template="monthly_image.php"; $mo=9; $listEvents=2; <--this i can set to 1 to only show one event require ("calendar/calendar.php"); ?> Does this request make sense to you? All help will be appreciated greatly, Realredd Hello all, hey, i need some help if possible. I basicly have 2 tables, one has the blog posts and one has the blog comments. I'm trying to display the latest 5 blog posts (which works) but underneath each of the blog posts i need to display about 3 of the latest comments for that post but it isn't showing any. any ideas? here's my code: Code: [Select] <? session_start(); $myusername = $_SESSION['myusername']; $db_host = 'localhost'; $db_user = 'HIDDEN'; $db_pwd = 'HIDDEN'; $database = 'tjwebsol_dev'; $table = 'posts'; $table2 = 'blog_comments'; $tab = '&#38;#160;&#38;#160;&#38;#160;&#38;#160;&#38;#160;&#38;#160;&#38;#160;&#38;#160;&#38;#160;&#38;#160;&#38;#160;&#38;#160;'; if (!mysql_connect($db_host, $db_user, $db_pwd)) die("Can't connect to database"); if (!mysql_select_db($database)) die("Can't select database"); // sending query $result = mysql_query("SELECT * FROM {$table} ORDER BY blog_id DESC LIMIT 5"); if (!$result) { die("Query to show fields from table failed"); } $sql = mysql_query("SELECT * FROM {$table2} ORDER BY comment_id ASC LIMIT 5 "); $fields_num = mysql_num_fields($result); $fields_num2 = mysql_num_fields($sql); while($row2 = mysql_fetch_assoc($sql)) { $blog_comments = $row2['comment_content']; $date_commented = $row2['date_commented']; $time_commented = $row2['time_commented']; $blog_username2 = $row2['username']; $blogid = $row2['blogid']; $comment_id = $row2['comment_id']; } while($row = mysql_fetch_assoc($result)) { $blog_title = $row['title']; $blog_content = $row['content']; $blog_username = $row['username']; $blog_date = $row['date_posted']; $blog_time = $row['time_posted']; $blog_id = $row['blog_id']; echo "<hr>"; echo "<div class='post'>"; echo "<h2 class='title'><a href='#'>$blog_title</h2></a>"; echo "<p class='byline'>posted by <b>$blog_username</b> on <b>$blog_date</b> ($blog_time)</p>"; echo "<br>"; echo "<div class='entry'>$blog_content</div><br>"; if ($blogid == $blog_id) { echo "<b>User Posted Comments:</b><br><br>"; echo "$tab<b>$comment_id</b>. $blog_comments"; echo "<br><br>"; echo "Commented posted by <b>$blog_username2</b> on <b>$date_commented ($time_commented)</b>"; echo "<br><br><br>"; } if (!isset($_SESSION['logged']) || $_SESSION['logged'] !== true) { // not logged in, move to login page echo "<b><a href='login.php'>Login</a></b> to post your comments!"; } echo "<br><br><br>"; include('blognewcomment.php'); echo ""; echo "</div>"; } mysql_free_result($result); ?> Hi all This is my first post but I hope someone can help. I am building a website using a theme that uses a template builder that includes a client scrolling carousel. When using it once it works fine... I need to use it 3 times. The second and third instance doesn't scroll and appears huge on the page. I am a novice at php but after a bit of research I believe its something to do with how the builder calls for the carousel and the ID. I am not sure how to amend the php to make each instance of the carousel have a different ID and consequently js and css div classes are called correctly. I hope this make sense and any help would be much appreciated Craig Hello,
I have problem with JS slider. Here is demo website http://goo.gl/bPzpAo I can't make the slider to have similar size items (seems cutted). I can't get, what's wrong there? Someone could help me with this?? I tried to resize images, also li elements modifications, but no solution. If someone could help me, will be much appreciated!
Regards,
Zox
I have an image carousel where the hyperlink worked just fine in all browsers that I tested UNTIL recently, now it works on IE and Opera; it no longer seems to work on Firefox, Safari and Chrome. Can someone give me an idea as to why that would happen? Here's the webpage: http://www.myalaskacenter.com and here's the coding used: Code: [Select] <?php echo '<div id="slider"><ul id="sliderContent">'; while ($Row = mysqli_fetch_assoc($Result)){ $EventName = $Row['EventTitle']; $url = $Row['ShoWareEventLink']; $image = $Row['eImage']; $description = $Row['BriefDescription']; $promoter = $Row['Presenter']; $starting = $Row['startDATE']; $ending = $Row['endDATE']; echo '<li class="sliderImage"><a href="' . $url . '"><img src="https://alaskapac.centertix.net/UPLImage/' . $image . '" alt="' . $EventName. '" title="' . $EventName . '" height="400" width="900" border="0" /></a><span class="right"><strong>' . $EventName . '</strong><br /><em><br />Presented by ' . $promoter . '</em><br />' . date("l, F j, Y", strtotime($starting)); if ($starting != $ending){ /**IF STARTING=ENDING =>NO ENDING SHOWN **/ echo '<br />to ' . date("l, F j, Y", strtotime($ending)); } echo '<br /><br />' . $description . '<br /><br /><a href="' . $url . '"><img src="https://alaskapac.centertix.net/UPLImage/z_BUY_Tickets_gold.gif" height="40" width="100" border="0" align="right" alt="' . $EventName . '" title="' . $EventName . '" /></a></span></li>'; } echo '<div class="clear sliderImage"></div></ul></div>'; ?>When I click to view the source in the non-working browsers, I cannot find an issue all the HTML looks like it should work. In fact there are two other "image carousels" on that page that do indeed work in these non-working browsers. Hello,
I'm creating a website that takes flickr photos from areas that you click on the map and loads them into a jquery carousel called Slick Carousel. Everything works fine except for I have this strange issue where the autoplay only begins if you click to another window or you manually move the thumbnails to the left or right. Then it works fine. Can anyone look at the code and see if they can see what I'm doing wrong?
<!DOCTYPE html> <html> <head> <!-- google maps api key --> <script src="http://maps.google.com/maps/api/js?key=AIzaSyAM4sSbWxrbwyXvGHvbH6piG5AlqLjtAMc&sensor=true" type="text/javascript"></script> <!-- jquery --> <script src="js/jquery.1.11.1.min.js"></script> <script src="js/jquery.ui.map.full.min.js"></script> <!-- scripts for lightbox --> <script src="js/lightbox.min.js"></script> <!-- script for actual display of images --> <!-- fonts --> <link href='http://fonts.googleapis.com/css?family=Pacifico|Open+Sans' rel='stylesheet' type='text/css'> <link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/jquery.slick/1.3.15/slick.css"/> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <link href="css/lightbox.css" rel="stylesheet" /> <link href="css/styles.css" rel="stylesheet" type="text/css"> </head> <body> <header> <h1>Time Capsule <i class="fa fa-space-shuttle"></i> </h1> <div id="drop_instructions"> <p>Ever wonder what a certain area looked like from the world's point of view? Now you can find out! Click on an area in the map and we'll show you that spot as the locals see it.</p> </div> </header> <section class="clearfix"> <div id="map_canvas"></div> <div id="imagebox" class="slider-for"> </div> </section> <div class="slider-nav"> </div> <script type="text/javascript" src="http://cdn.jsdelivr.net/jquery.slick/1.3.15/slick.min.js"></script> <script src="js/map.js"></script> </body> </html> $(document).ready(function() { $('#drop_instructions').hide(); $('#header').click(function(){ $('#drop_instructions').fadeToggle( "fast", "linear" ); }); //define lat and long globally so they can be used elsewhere var lat=0; var lng=0; var city=''; var state=''; var StartLatLng = new google.maps.LatLng(28.4158, -81.2989); $('#map_canvas').gmap({ 'center': StartLatLng, zoom: 10, styles: [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}] }) .bind('init', function(event, map) { $(map).click( function(event) { //define date var year = $("#year").val(); var month = $("#month").val(); var day = $("#day").val(); //give current value to lat/long on click lat=event.latLng.lat(); lng=event.latLng.lng(); var latlng= event.latLng; //input box with coordinates $('#latlng').val(lat+', '+lng); geocoder = new google.maps.Geocoder(); geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { //Check result 0 var result = results[0]; //look for locality tag and administrative_area_level_1 for(var i=0, len=result.address_components.length; i<len; i++) { var ac = result.address_components[i]; if(ac.types.indexOf("locality") >= 0) city = ac.long_name; if(ac.types.indexOf("administrative_area_level_1") >= 0) state = ac.long_name; } //only report if we got Good Stuff if(city != '' && state != '' && year != '') { console.log("Hello to you are in "+city+", "+state+"! The date you chose is: " + month + " " + day + ", " + year); } else { console.log("YOU FORGOT TO PICK A YEAR!"); } } //end of getting city //==============Image generation================= //get location from map click and inject data into URL var locationURL = "https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=a0f6800f62ea920f00472805d767ac5c&lat="+lat+"&lon="+lng+"&format=json&nojsoncallback=1"; $.ajax({ url: locationURL, dataType: "json", success:function(data){ var farmId; var serverId; var photoId; var secret; var title; //hide instructions once content is generated $('#instructions').fadeOut(500); //title the images for the city clicked on $('#images_title').append('<h3>'+city+' , '+state+'</h3>'); console.log(data); //generate thumbnails user can click on for (i=0; i < 20; i++){ farmId = data.photos.photo[i].farm; serverId = data.photos.photo[i].server; photoId = data.photos.photo[i].id; secret = data.photos.photo[i].secret; title = data.photos.photo[i].title; // make the urls for the DOM photoURL = "https://farm"+farmId+".staticflickr.com/"+serverId+"/"+photoId+"_"+secret+"_z.jpg"; thumbURL = "https://farm"+farmId+".staticflickr.com/"+serverId+"/"+photoId+"_"+secret+"_s.jpg"; //append the clickable thumbnails to the dom $('.slider-for').slickAdd('<div><img src="'+photoURL+'" alt="'+title+'" /></div>'); $('.slider-nav').slickAdd('<div><img src="'+thumbURL+'" class="image_thumb" alt="'+title+'" /></a></div>'); } //change background of page to an image that is displayed $("body").css("background-image", "url('"+photoURL+"')"); } }); }); }); }); }); $('.slider-for').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: true, fade: true, asNavFor: '.slider-nav' }); $('.slider-nav').slick({ arrows: true, slidesToShow: 3, slidesToScroll: 1, asNavFor: '.slider-for', dots: true, centerMode: true, focusOnSelect: true, autoplay: true, autoplaySpeed: 2000 }); Hi all new to php and this forum i have been looking around and im very impressed most questions get answered not like on some of the forums around.
Is there any one kind enough to help me out i have an api call via php and would like to output the results to owlcarousel where do i start with this.
Code i have is:
<?php error_reporting(E_ALL); // Turn on all errors, warnings and notices for easier debugging // API request variables $endpoint = 'http://svcs.ebay.com/services/search/FindingService/v1'; // URL to call $version = '1.0.0'; // API version supported by your application $appid = 'YourAppID'; // Replace with your own AppID $globalid = 'EBAY-GB'; // Global ID of the eBay site you want to search (e.g., EBAY-DE) $query = 'tools'; // You may want to supply your own query $safequery = urlencode($query); // Make the query URL-friendly // Construct the findItemsByKeywords HTTP GET call $apicall = "$endpoint?"; $apicall .= "OPERATION-NAME=findItemsIneBayStores"; $apicall .= "&SERVICE-VERSION=$version"; $apicall .= "&SECURITY-APPNAME=$appid"; $apicall .= "&GLOBAL-ID=$globalid"; $apicall .= "&keywords=$safequery"; $apicall .= "&storeName=yourstorename"; $apicall .= "&paginationInput.entriesPerPage=6"; $apicall .= "&paginationInput.pageNumber=1"; // Load the call and capture the document returned by eBay API $resp = simplexml_load_file($apicall); // Check to see if the request was successful, else print an error if ($resp->ack == "Success") { $results = ''; // If the response was loaded, parse it and build links foreach ($resp->searchResult->item as $item) { $pic = $item->galleryURL; $link = $item->viewItemURL; $title = $item->title; $price = $item->currentPrice; // For each SearchResultItem node, build a link and append it to $results $results .= "<div id='item'><div class='img-wrap' align='center'><img src=\"$pic\" class='itemimg'></div> <div class='itemtxt' align='center'><a href=\"$link\">$title</a>$price</div></div>"; } } // If the response does not indicate 'Success,' print an error else { $results = "<h3>Oops! The request was not successful. Make sure you are using a valid "; $results .= "AppID for the Production environment.</h3>"; } ?> <html> <head> <body> <table> <tr> <td> <div id="result"> <?php echo $results;?> </div> </td> </tr> </table> </body> </html>Im sure is pretty basic but being new to this i have no idea where to start, any advice would be much appreciated. thanks Edited by didz666, 25 January 2015 - 02:22 PM. i have 8 division (div), i want to display 4 rows in 4 division and the remain 4 rows in the next 4 division here is my code structure for carousel
<div class="nyie-outer"> second row third row
fourth row fifth row sixth row seven throw eighth row
</div><!--/.second four rows here-->
sql code
CREATE TABLE product( php code
<?php how can i echo that result in those rows
Hi, I will start off trying to explain what I am trying to make the best I can. What I want to create is a script that gets the gold value from this website: http://www.lbma.org.uk/pages/index.cfm?page_id=46&title=current_statistics and then save it to a variable which I will use to calculate values of different gold karats. Here is the content in bold I need on the website I linked: Quote LONDON GOLD FIXING USD GBP EUR AM 1588.00 1005.127 1251.083 PM 1589.50 1004.741 1249.803 So what help do I need? Well, I don't expect you to figure out the calculating part for me but some help how to get that content pointed out above and save it to a variable is what I would appreciate getting some help with. I don't know much PHP, only some and I have been trying to figure this out for a day now without any success. I suppose php get contents and/or curl should be used here but I don't know how really. I would very much appreciate the help I can get on this. Thank you! I have looked around. And what I came across was not necessarily what I was looking for.
I was wondering if somebody can recommend a good tutorial for building a blog in PHP OOP?
Also, I was wondering if somebody perhaps knows a good blog app written in PHP OOP, where I could be learning from the script files?
Hey I have this blog http://www.nikita-andrews.com/ingrid/?page_id=34 ... Im trying to remove the prettyphoto enlargement on posts to this page ... and not sure how to go about it. The code for thumbnail.php is Code: [Select] <?php if (has_post_thumbnail()) { $data = get_post_meta( $post->ID, 'key', true ); if ($data[ 'project_link' ]) { ?> <a class="externalLink tooltip" title="View Live Site" target="_blank" href="<?php echo $data[ 'project_link' ]; ?>">∞</a> <?php } ?> <?php $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large'); if ($data[ 'video_link' ]) { ?> <a class="thumbLink video" rel="prettyPhoto" href="<?php echo $data[ 'video_link' ]; ?>"> <?php } else { echo '<a class="thumbLink" href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" >'; } the_post_thumbnail(); echo '</a>'; } ?> I want the thumbnails to still show but just not enlarge. Infact itd be even better if they just linked directly to the post itself. Any help would be much appreciated! So I started a blog project just to help me out with learning php. This is my post form <form action="insert.php" method="post"> Title: <input type="text" name="title"> <br> Post: <input type="text" name="post"> <br> Author: <input type="text" name="author"> <br> <input type="submit"> </form> Insert.php <?php $con = mysqli_connect("localhost","test","","test"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // escape variables for security $title = mysqli_real_escape_string($con, $_POST['title']); $content = mysqli_real_escape_string($con, $_POST['post']); $author = mysqli_real_escape_string($con, $_POST['author']); $sql="INSERT INTO article (title, content, author) VALUES ('$title', '$content', '$author')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } echo "1 record added"; mysqli_close($con); ?> But when I try to display that information he <h1>Title: </h1> <?php echo $title; ?> <h2>Content: </h1> <?php echo $content; ?> <h3>Posted by: </h1> <?php echo $author; ?>It doesn't work and I get this: ( ! ) Notice: Undefined variable: title in C:\wamp\www\test\index.php on line 33 Call Stack # Time Memory Function Location 1 0.0000 239144 {main}( ) ..\index.php:0 Content: ( ! ) Notice: Undefined variable: content in C:\wamp\www\test\index.php on line 34 Call Stack # Time Memory Function Location 1 0.0000 239144 {main}( ) ..\index.php:0 Posted by: ( ! ) Notice: Undefined variable: author in C:\wamp\www\test\index.php on line 35 Call Stack # Time Memory Function Location 1 0.0000 239144 {main}( ) ..\index.php:0The form works because when I looked at the database, the information was there. The problem is getting that information and displaying it in the right place, how can i fix that? Just in case, this is my index: <?php include ('connect.php'); include ('header.php'); ?> <div id="container"> <div id="rightcol"> <form action="insert.php" method="post"> Title: <input type="text" name="title"> <br> Post: <input type="text" name="post"> <br> Author: <input type="text" name="author"> <br> <input type="submit"> </form> </div> <div id="content"> <h1>Title: </h1> <?php echo $title; ?> <h2>Content: </h1> <?php echo $content; ?> <h3>Posted by: </h1> <?php echo $author; ?> </div> </div> <?php include "footer.php"; ?> </div> hello, i have been trying to find scripts or write a custom php script so i can have a feedback/comment type blog on my website. im trying to go for the same type of design layout and function as the blog on this site: http://www.jessicaswift.com/treasuring/ I have found a few scripts but they are on sites that want me to pay for the scripts and coding, but im not sure if its legit or even what im looking for cause they dont have full demos of them. if anyone could help me out by pointing me in the right direction with a website or tutorial for what im trying to do. Im not sure if javascript would be better for what im trying to do. cause i dont want to have a full out blog like from wordpress or blogger.com my site im building for my sister is www.jessicadurrant.com if you go to the blog page you will see its a wordpress blog, which i dont want to use. i would like to set up something like the blog that is on the first website link i posted about. Again any help would be greatly appreciated. Hi guys, Am having trouble with my OO php blog. i can add, delete and search for messages but cannot update them as i get the folowing eror message (see below) Quote Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM messages WHERE id = NULL' at line 1' Have checked that when i hover over the link i do get an id number and it is pointing to the correct cmd i.e. blogAmend. Any ideas as to where i am going wrong, files attatched for further info. Hi am in the middle of making a blog but am having problems with one page am working on if anyone can help me please. What is am looking for is to post username and avatar instead of just the username. I have already paid some guy to work on this but he didnt get back to me and ihave no more cash to give for the code to be finished so i would really appreciate if someone could help to finish this off please thanks. this is the where the username and text shows which i would like avatar to show as well. Code: [Select] <?php $query = yasDB_select("SELECT * FROM user WHERE username = '$user'"); $row = $avatarfile; $query = yasDB_select("SELECT * FROM topic WHERE userid = '$id' ORDER BY id DESC LIMIT 5"); if($query->num_rows == 0) { ?> <div id="memberstext">This topic has no comments, be the first to add one!</div> <?php } else { while($row = $query->fetch_array(MYSQLI_ASSOC)) { $text = $row['comment']; $text = str_replace(':D','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/biggrin.gif" title="biggrin" alt="biggrin" />',$text); $text = str_replace(':?','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/confused.gif" title="confused" alt="confused" />',$text); $text = str_replace('8)','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/cool.gif" title="cool" alt="cool" />',$text); $text = str_replace(':cry:','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/cry.gif" title="cry" alt="cry" />',$text); $text = str_replace(':shock:','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/eek.gif" title="eek" alt="eek" />',$text); $text = str_replace(':evil:','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/evil.gif" title="evil" alt="evil" />',$text); $text = str_replace(':lol:','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/lol.gif" title="lol" alt="lol" />',$text); $text = str_replace(':x','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/mad.gif" title="mad" alt="mad" />',$text); $text = str_replace(':P','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/stlyes/images/smileys/razz.gif" title="razz" alt="razz" />',$text); $text = str_replace(':oops:','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/redface.gif" title="redface" alt="redface" />',$text); $text = str_replace(':roll:','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/rolleyes.gif" title="rolleyes" alt="rolleyes" />',$text); $text = str_replace(':(','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/sad.gif" title="sad" alt="sad" />',$text); $text = str_replace(':)','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/smile.gif" title="smile" alt="smile" />',$text); $text = str_replace(':o','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/surprised.gif" title="surprised" alt="surprised" />',$text); $text = str_replace(':twisted:','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/twisted.gif" title="twisted" alt="twisted" />',$text); $text = str_replace(':wink:','<img src="' . $siteurl . 'templates/' . $setting['theme'] . '/styles/images/smileys/wink.gif" title="wink" alt="wink" />',$text); if ( $row['useavatar'] == '1' ) { $avatarimage = $siteurl . 'avatars/' . $row['avatarfile']; } else { $avatarimage = $siteurl . 'avatars/useruploads/noavatar.gif'; } ?> <div id="box"> <div class="name"><img src="<?php echo $avatarimage;?>" height="40" width="40" align="left"><br /><?php echo $row['name'];?></div> <div class="comment_text"><?php echo $text;?></div></div> This is the form part of it to add the text Code: [Select] <div id="box2"> <form name="addcomment" method="post" action=""> <strong>Message:</strong><br /> <textarea name="comment" rows="3" cols="40" id="comment_message"></textarea><br /> <input name="userid" type="hidden" value="<?php echo $id;?>" /> <input type="hidden" name="timestamp" id="timestamp" value="<?php echo time(); ?>" /> </center> <!-- start of smiles --> <div id="smiles"><center> <a href="javascript:addsmilie(' :D ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/biggrin.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :? ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/confused.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' 8) ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/cool.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :cry: ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/cry.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :shock: ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/eek.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :evil: ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/evil.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :lol: ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/lol.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :x ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/mad.gif';?>" border="0" /></a><br /> <a href="javascript:addsmilie(' :P ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/razz.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :oops: ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/redface.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :roll: ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/rolleyes.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :( ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/sad.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :) ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/smile.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :o ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/surprised.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :twisted: ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/twisted.gif';?>" border="0" /></a> <a href="javascript:addsmilie(' :wink: ')"><img src="<?php echo $siteurl.'templates/'.$theme.'/styles/images/smileys/wink.gif';?>" border="0" /></a> </center></div> <input name="name" type="hidden" value="<?php echo $_SESSION['user'];?>" /><br /> <input name="addcomment" type="submit" value="Add Comment" style="border: 1px solid #000; margin-top: 2px;" /> </form></div> |