Jump to content

doddsey_65

Members
  • Posts

    902
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by doddsey_65

  1. I just started this today, but it's a portfolio that I am trying to build up over time. I would like crits on the general layout and graphical design. It's only the home page at the minute. Also crits on home page content would be nice. Thanks. http://www.portfolio.asimpleforum.co.uk/
  2. Sessions are automatically destroyed when the browser is closed.
  3. When a user clicks on a topic they are transfered to its post, which is retrieved by the name of the topic as given by the url value. up to now i have just used urlencode. But its trickier when a user adds slashes and dots into the mix. for example the title of the post is testing/testing. The url will go to www.asimpleforum.co.uk/t/testing/testing. How would i get around this since url encode doesnt do the job? I could replace slashes and dots with their own unique symbol but that produces the problem when someone uses one of those symbols that i use to replace in their topic title. I know one site in particular that replaces all dots and slashes with a hyphen (-), but how would you know what to turn the hyphen into when you query the database for that topic? Anyone have any ideas?
  4. Thanks for the reply. The parse error in the profile walls has been fixed with the new template system. The user center has been removed, though you can not change your timezones currently. Ive also fixed the error in the like system so hopefully everything should work now.
  5. you will need to use preg_match_all which will save all of the matches into an array. you can the display each video that appears in the array.
  6. When entering the same url multiple times I get a different short link for each one. Maybe have some sort of check to see if the url exists in your records, then throw its short url rather than creating a new one
  7. People that had logins before will need to clear their domain cookies as those old cookies are associated with account that no longer exist hence the message. Alternatively you can visit http://www.asimpleforum.co.uk/clear_cookies.php to clear the cookies automatically.
  8. well after a little over a weeks worth of solid coding I have restored ASF to most of it's former glory. Testing has been done, but only by me so i would appreciate it if someone could retest this new version. http://www.asimpleforum.co.uk/ Most of the modules and features are complete. The only ones that arent are moderator and admin functions. Thanks
  9. erm....no. result1 would be the same as result 2 since its returning the same query
  10. The following union query is supposed to return the total number of alerts and the total number of messages, however a dump of the returned array shows only the alerts(num_alerts). $sql = "SELECT COUNT(a.a_aid) as num_alerts FROM ".Asf_Db::$prefix."alerts a UNION SELECT COUNT(m.m_mid) as num_messages FROM ".Asf_Db::$prefix."messages m"; $sth = Asf_Core::$db->prepare($sql); $sth->execute() or die(Asf_Core::$db->error($sth, $sql)); $results = $sth->fetch(PDO::FETCH_ASSOC); dump($results); anyone see where im going wrong?
  11. I agree with thorpe. There really isn't any point in creating a post just to basically say "yeah what that guy said". You should only post if you have an alternative solution to someones problem or a better method. Or in some cases to elaborate more where the original solution may be lacking as such.
  12. your 404 error is probably due to this: Header("Location: $HTTP_REFERER"); $HTTP_REFERER doesnt exist in your script. Did you perhaps mean header("Location: ".$_SERVER['HTTP_REFERER']); You need to place the jquery code within your HTML. Heres a quick example. You will need to include the jQuery script, either download it from their website or use googles CDN. <script type="text/javascript"> $(document).ready(function(){ $('form').submit(function(e){ // the below code will fire when the form is submitted e.preventDefault(); // don't send the form via HTTP method $.post('.shout.php', { name : $('input[name="name"]').val(), url : $('input[name="url"]').val(), email : $('input[name="email"]').val(), message : $('input[name="message"]').val(), }, function(data) // data is what will be returned from shout.php { alert(data); // do something with the data } }); </script> Then in shout.php instead of using header() to redirect them simply echo something to be sent back to the client script echo 'Form submitted'; You will then get an alert saying Form submitted.
  13. perhaps you should try and start the "quest" first and then come back with some code to show us. no one is going to write code for you, But i may do it if you pay me $50. You can write post content to a file using fopen() and fwrite(). You will need to look into jquery's $.post() function in order for your code to post without a refresh.
  14. Not many people will disable javascript. And alot of the major websites use no fallbacks at all for the lack of javascript. Look at facebook, twitter and youtube. Most of their functions are done with javascript, but they don't work at all if javascript is disabled. Saying that though, the search feature is the core component of your website, so there should be a fallback. If someone does visit with no javascript then theres no point in staying on your site. I only provide no fallbacks on extended functions that dont really impact the functionality of the site.
  15. Im using preg_replace in my template and hook system but have come across a problem. content within a loop is defined in the html as <loop_name-loop_key> so it replaces this with content in the loop which works fine. But adding <loop_name-loop_key> to another custom tag breaks the script. <asf: hook="post_message" params="<loop_name-loop_key>"> doesnt work because the preg_replace has already replaced <loop_name-loop_key> with its php values. I need to replace <loop_name-loop_key> only if it isnt within any other tags like the hook tag. Heres my preg_replaces $content = preg_replace('|\<'.$key.'\-'.$l_key.'\>|i', "<?php echo \$this->tpl_data['$key']['$l_key'][\$i]; ?>", $content); $content = preg_replace('|^\<asf: hook="([a-zA-Z0-9_-]+)" params="\<'.$key.'\-'.$l_key.'\>"\>(.*?)<\/asf: hook\>|sie', "\$this->replace_hook('\\1', '\\3', array(\$this->tpl_data['$key']['$l_key'][$i]));", $content); as you can see since the loop is being replaced before the hook the hook statement becomes invalid. How do i make sure the loop in only replaced if it's not in any other tags? I tried using ^ and $ to define beginning and end but it doesn't work, probably due to the indentation of the html.
  16. For my friend system usernames are stored in a table (f_username) along with the username of the friend (f_friend_username). Im trying to display the friends of a user on their profile but the users username can be in either the f_username column or the f_friend_username column. So i have this query but it returns the same result twice. Is there a better way around this? I thought about a conditional ON statement but don't know if it's possible. $sql = "SELECT f.*, u.u_avatar FROM ".Asf_Db::$prefix."friends f JOIN ".Asf_Db::$prefix."users u ON ( f.f_username = u.u_username OR f.f_friend_username = u.u_username ) WHERE ( f_username = ? OR f_friend_username = ? ) AND f_confirmed = ?"; $sth = Asf_Core::$db->prepare($sql); $sth->execute(array( $username, $username, 1 ) ) or die(Asf_Core::$db->error($sth, $sql));
  17. WHILE($rows = mysql_fetch_array($query)): $nickname = (!empty($rows['nickname'])) ? $rows['nickname'] : $user; // tells it to display username if nickname is empty echo $nickname; endwhile;
  18. use the [ php \] and [/ php \] tags without the ending backslashes. For your query just use !empty WHILE($rows = mysql_fetch_array($query)): $nickname = (!empty($rows['nickname'])) ? $rows['nickname'] : $rows['username']; // tells it to display username if nickname is empty echo $nickname; endwhile;
  19. just my luck, server uses 5.2. Is there any way I could achieve the same thing?
  20. once you have the old score, add it to a session which can be called later when needed.
  21. Using this locally works fine: $html = $name::add_content($name, $html); but i get the double colon error whe using it live. $name is a name of a valid class. What could throw this error when it works locally?
  22. Heres my crits: when the page first loads, it all seems a bit jumpy. The logo is hard to see againt the black no vaild doctype or encoding has been specified your notice div is included outside the body tags <hr> is not valid XHTML align="center" is not valid XHTML the message for no words fades out too quickly, so you cannot click add word to dictionary
  23. well if you want critique on the website this would involve coding. Theres really no reason to encrypt your javascript file.
  24. you should make an input button for the search box, it took me a while to realise it only searched on blur. Also when I did get some search results they disappeared after a few seconds. Has your main.js file been encrypted or something?
  25. I taught myself php a few years ago by reading through code and experimenting, from there javascript isn't that hard. And jQuery is a lot easier. I just read through other peoples code and experiment with different ideas. I'm not the type of person that can read tutorials or books, nor do I do any sort of planning on paper. I jump on the computer and try something. ASF was never planned, I just wrote the code and tried different things.
×
×
  • 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.