Jump to content

Matpatnik

Members
  • Posts

    227
  • Joined

  • Last visited

Everything posted by Matpatnik

  1. Hi guys,I know absolutely nothing about JavaScriptHere is the link of the page: page testit give me this error This is the code before I did some modification<script type="text/javascript"><!--var time = 3000;var numofitems = 7;//menu constructorfunction menu(allitems,thisitem,startstate){ callname= "gl"+thisitem; divname="subglobal"+thisitem; this.numberofmenuitems = 7; this.caller = document.getElementById(callname); this.thediv = document.getElementById(divname); this.thediv.style.visibility = startstate;}//menu methodsfunction ehandler(event,theobj){ for (var i=1; i<= theobj.numberofmenuitems; i++){ var shutdiv =eval( "menuitem"+i+".thediv"); shutdiv.style.visibility="hidden"; } theobj.thediv.style.visibility="visible";} function closesubnav(event){ if ((event.clientY <48)||(event.clientY > 107)){ for (var i=1; i<= numofitems; i++){ var shutdiv =eval('menuitem'+i+'.thediv'); shutdiv.style.visibility='hidden'; } }}// --></script>...<script type="text/javascript"> <!-- var menuitem1 = new menu(7,1,"hidden"); var menuitem2 = new menu(7,2,"hidden"); var menuitem3 = new menu(7,3,"hidden"); var menuitem4 = new menu(7,4,"hidden"); var menuitem5 = new menu(7,5,"hidden"); var menuitem6 = new menu(7,6,"hidden"); var menuitem7 = new menu(7,7,"hidden"); // --></script> how can I fix this?Thank you for your help
  2. You can use a database to store eg: the name and then use SELECT... to echo it or you can use a cookie to keep the information temporary [edited] or using session depending on what you need to do
  3. Nope it does the same thingMaybe I did something wrong in this part! while($nrow = mysql_fetch_array($nresult)) { if ($nrow['news_date'] == $nrow['news_lastmod']) { $lastmod = ""; } else { $lastmod = "Last modification: " . $nrow['news_lastmod']; } echo "<div class=\"story\">\n"; echo "<h4>" . $nrow['news_title'] . "</h4>\n<p>\n"; echo BBCode($nrow['news_info']) . "<br />\n"; echo "<span class=\"small\">" . $nrow['news_date'] . " " . $lastmod . "</span>\n"; echo "</p>\n</div>\n";}echo "</div>\n"; here is the link here
  4. Matpatnik

    Scroll Bar

    in <textarea> you can only write plain textfor the scroll bar I'm not sure to understand what you need but you can use frame
  5. You open multiple time php tag inside other php tag! I don't think you can do that.try this:<?phpif (isset($_GET[view])){ if (isset($_GET[userid])){ include "http://www.webdkp.com/remote.php?view=" . $_REQUEST['view'] . "&id=8559&tableid=1&userid=" . $_REQUEST['userid'] . "; } else { include "http://www.webdkp.com/remote.php?view=" . $_REQUEST['view'] . "&id=8559&tableid=1"; }}?>
  6. Hi guys, Here is my problem, I'm using BBCode to format my $Text but the breaking line doesn't work it suppose to show <br /> instead of <br>The $Text is from a database, here is the code: function BBCode($Text) {// Replace any html brackets with HTML Entities to prevent executing HTML or script // Don't use strip_tags here because it breaks [url] search by replacing & with amp $Text = str_replace("<", "<", $Text); $Text = str_replace(">", ">", $Text); // Convert new line chars to html <br /> tags $Text = nl2br($Text); // Set up the parameters for a URL search string $URLSearchString = " a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'"; // Set up the parameters for a MAIL search string $MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@"; // Perform URL Search $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="$1" target="_blank">$1</a>', $Text); $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text); $Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text); // Perform MAIL Search $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '<a href="mailto:$1">$1</a>', $Text); $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '<a href="mailto:$1">$2</a>', $Text); // Check for bold text $Text = preg_replace("(\[b\](.+?)\[\/b])is",'<span class="bold">$1</span>',$Text); // Check for Italics text $Text = preg_replace("(\[i\](.+?)\[\/i\])is",'<span class="italics">$1</span>',$Text); // Check for Underline text $Text = preg_replace("(\[u\](.+?)\[\/u\])is",'<span class="underline">$1</span>',$Text); // Check for strike-through text $Text = preg_replace("(\[s\](.+?)\[\/s\])is",'<span class="strikethrough">$1</span>',$Text); // Check for over-line text $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'<span class="overline">$1</span>',$Text); // Check for colored text $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1\">$2</span>",$Text); // Check for sized text $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","<span style=\"font-size: $1px\">$2</span>",$Text); // Check for list text $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '<ul class="listbullet">$1</ul>' ,$Text); $Text = preg_replace("/\[list=1\](.+?)\[\/list\]/is", '<ul class="listdecimal">$1</ul>' ,$Text); $Text = preg_replace("/\[list=i\](.+?)\[\/list\]/s", '<ul class="listlowerroman">$1</ul>' ,$Text); $Text = preg_replace("/\[list=I\](.+?)\[\/list\]/s", '<ul class="listupperroman">$1</ul>' ,$Text); $Text = preg_replace("/\[list=a\](.+?)\[\/list\]/s", '<ul class="listloweralpha">$1</ul>' ,$Text); $Text = preg_replace("/\[list=A\](.+?)\[\/list\]/s", '<ul class="listupperalpha">$1</ul>' ,$Text); $Text = str_replace("[*]", "<li>", $Text); // Check for font change text $Text = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])","<span style=\"font-family: $1;\">$2</span>",$Text); // Declare the format for [code] layout $CodeLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="quotecodeheader"> Code:</td> </tr> <tr> <td class="codebody">$1</td> </tr> </table>'; // Check for [code] text $Text = preg_replace("/\[code\](.+?)\[\/code\]/is","$CodeLayout", $Text); // Declare the format for [quote] layout $QuoteLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="quotecodeheader"> Quote:</td> </tr> <tr> <td class="quotebody">$1</td> </tr> </table>'; // Check for [code] text $Text = preg_replace("/\[quote\](.+?)\[\/quote\]/is","$QuoteLayout", $Text); // Images // $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '<img src="$1">', $Text); // [img=widthxheight]image source[/img] $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '<img src="$3" height="$2" width="$1">', $Text); return $Text;} I tried to use $Text = str_replace(array("\r\n", "\r", "\n"), "<br />", $Text); but it doesn't work.I do have an other problem, is I don't know how to avoid the breaking line in the list. Do I have to create a filter before insert it in the database?
  7. Thank you guysNow the JavaScript is working perfectly after I fixed the subglobal1 like jesh said.I did validate the page except for the bbcode that I will have to find a way to escape the line breaking inside of the of the <ul></ul>
  8. Yes I realise that I've closed the feature id before open it I will validate the page now, everything is fine except the JavaScriptthe <ul class="listupperroman"><br /><li> Text<br />...it's probably while I type the bbcode I press enter for each tag and when display on the browser it look at avery breaking point in the database.
  9. here my page, things work good except the footer which show up in the header and the JavaScript in the footer You can have a quick look [edited] I do change some variable name and erase some part of the code but only is it's important to keep it "secret" or if it's useless[/edited]
  10. I have fixed the repetition. I think the 2nd while statement didn't like to ouside and inside of the php code.The $ect variable is the connection to the database and no I did the code by my own except for the template and the JavaScript which was in it.I'm trying to mould the template the way I need it
  11. Hi guys,I have a weird result in my page, it duplicate the footer in the bg of the page and keep going untill the browser crash!here is the pages: /***** head.php *****/<?php// close the main table, the database and the pagefunction getfooter($ect) { include ("foot.php");}?>/***** main page *****/<?phpinclude "head.php";$wsql = "SELECT welcome_title, welcome_intro FROM welcome " . "ORDER BY welcome_lastmod DESC " . "LIMIT '" . $a_welcome . "'";$wresult = mysql_query($wsql) or die(mysql_error());while($wrow = mysql_fetch_array($wresult)) { echo "<div class=\"feature\">\n <h3>" . $wrow['welcome_title'] . "</h3>\n <p>" . BBCode($wrow['welcome_intro']) . "</p>\n </div>\n";}$nsql = "SELECT * FROM news ORDER BY news_lastmod DESC LIMIT '" . $a_lastnews . "'";$nresult = mysql_query($nsql) or die(mysql_error());while($nrow = mysql_fetch_array($nresult)) { if ($nrow['news_date'] == $nrow['news_lastmod']) { $lastmod = ""; } else { $lastmod = "Last modification: " . $nrow['news_lastmod']; }?> <div class="story"> <p><?php echo "<a href=\"#\" class=\"capsule\">" . $nrow['news_title'] . "</a><br>"; echo BBCode($nrow['news_info']) . "<br>"; echo "<span class=\"small\">" . $nrow['news_date'] . " " . $lastmod . "</span></div>";?> </p><hr> </div><?php}echo "We have " . mysql_num_rows($result) . " differents pictures on our site<br>\n";echo "hey\n";getfooter($ect);?>/***** foot.php *****/ </div> <div id="siteInfo"> <img src="" width="44" height="22"> <a href="#">About Us</a> | <a href="#">Site Map</a> | <a href="#">Privacy Policy</a> | <a href="#">Contact Us</a> | © 2002 - 2007 </div> </div> <!--end pagecell1--> <br> <"script type="text/javascript"> <!-- var menuitem1 = new menu(7,1,"hidden"); var menuitem2 = new menu(7,2,"hidden"); var menuitem3 = new menu(7,3,"hidden"); var menuitem4 = new menu(7,4,"hidden"); var menuitem5 = new menu(7,5,"hidden"); var menuitem6 = new menu(7,6,"hidden"); var menuitem7 = new menu(7,7,"hidden"); // --> </script></body></html><?phpmysql_close($connect);?> any idea of what can cause that duplication?Thank you for your help
  12. Thank you Prateek but it's not what I'm looking for. I find a code at http://lampgeekz.netgeekz.net/ but there is some part missing, I will try to find a more complet code with more explanation.
  13. Thank you MrAdam I didn't think about this situation
  14. Hey thank you I didn't know the english term, I'll take a look at that tomorow morning
  15. ok it work good and I did managed the link to the originalThe code look like this now $sql = "SELECT images_id, images_name FROM images ORDER BY images_lastmod DESC LIMIT 9";$result = mysql_query($sql) or die (mysql_error());echo "<table>";$x = 1;while ($row = mysql_fetch_array($result)) { if ($x == 1) { echo "<tr>\n"; echo "<td><a href=\"picture.php?action=3&id=" . $row['images_id'] . "\"> <img src=\"../images/3/thumbs/" . $row['images_id'] . ".gif\" alt=\"" . $row['images_name'] . "\" border=\"0\" /></a></td>\n"; $x++; } elseif ($x == 2) { echo "<td><a href=\"picture.php?action=6&id=" . $row['images_id'] . "\"> <img src=\"../images/6/thumbs/" . $row['images_id'] . ".gif\" alt=\"" . $row['images_name'] . "\" border=\"0\" /></a></td>\n"; $x++; } elseif ($x == 3) { echo "<td><a href=\"picture.php?action=1&id=" . $row['images_id'] . "\"> <img src=\"../images/1/thumbs/" . $row['images_id'] . ".gif\" alt=\"" . $row['images_name'] . "\" border=\"0\" /></a></td>\n"; echo "</tr>\n"; $x = 1; }}echo "</table>"; Now how do I do the link at the bottum of the page?ie: if I have 100 picture I will have 12 pages including the one we are on
  16. Nice I didn't think of that, simple enough
  17. All the picture name are stored in the database by the id number ex: 1 == 1.jpg (original) and 1.gif (thumb) They are all stored in specific folder, each section contain it's own set of picture No, I have no idea how to start. I gess I can start to learn how to display the picture 3x3 in a table
  18. Matpatnik

    Gallery picture

    Hi guys, I need to know how to display a gallery, something simple but with those specification: 9 pictures thumbnails which are not the same as the original: 3 rows by 3 cols at the bottum of the page it will show all the link of the next page that contain a maximum of 9 pictures when clicking on the picture it display the original picture with all it's information (I think I can figured this one) It's a very basic gallery that I would like to create but I have no idea where to start.I don't even know how to display something in a 3x3 table without repetision Thank you
  19. Oh I see, it make sense now thank youedited: it work perfectly now
  20. ini_set("display_errors", 1); = 1error_reporting(E_ALL); = 2039edited: Notice: Undefined index: action in /usr/local/4admin/apache/vhosts/My_site.com/httpdocs/ain/include/ac.php on line 10this one work fine and doesn't affect the page
  21. the open_basedir and safe_mode it doesn't show anything but I turned it off last month manually
  22. Hi, it did print the right path: and the permission of the folder are set as 777is there a more secure way to set my folder so I can add stuffin it?
  23. When I was using /images/ it uploaded into the same folder that I was like if i was in this/ then I would need a folder this/images/ to store the image.By using the whole path wouldn't add it to this/ ?edited: It give me the same error but with the whole path, here is my code: $ImageDir = $_SERVER['DOCUMENT_ROOT'] . "/images/" . $_POST['image_section']; // upload image and check for image type if (move_uploaded_file($_FILES['image_filename']['tmp_name'], $ImageDir)) {
×
×
  • Create New...