Jump to content

creata.physics

Members
  • Posts

    261
  • Joined

  • Last visited

    Never

Everything posted by creata.physics

  1. Make sure $mysql is a resource or object, however you're using it; I would try var_dump($mysql); after GetMySQLHandle($mysql); if $mysql is null then that's where your issue is.
  2. It's my pleasure, please mark this topic as solved please.
  3. change if (isset($_POST['submit'])) to if (isset($_POST['id']))
  4. Are you sure it's not because you're ending the ul tag in the wrong place? Seems like the code should be: <?php $mainlinks = mysql_query("select * from ns_categories"); while ($catlinks = mysql_fetch_array($mainlinks)) { $catlinkname = $catlinks['name']; $catlinkid = $catlinks['id']; $sublinks = mysql_query("select * from ns_subcategories where mainid='$catlinkid'"); echo "<ul>"; echo "<li><a href='products.php?mc=$catlinkid'>$catlinkname</a></li>"; while ($catsublinks = mysql_fetch_array($sublinks)) { $sublinkname = $catsublinks['name']; $sublinkid = $catsublinks['id']; echo "<ul>"; echo "<li><a href='products.php?sc=$sublinkid>$sublinkname</a></li>"; echo "</ul>"; } echo "</ul>"; } ?> If that is not the issue, I would do a var_dump to check and see what mysql_fetch_array returns, by adding: var_dump($catlinks); under while ($catlinks = mysql_fetch_array($mainlinks)) { And also adding: var_dump($catsublinks); under while ($catsublinks = mysql_fetch_array($sublinks)) { And the array returned from both of them should have all the categories and sub categories that are inside your table, if not, there is an issue with the query, which would not seem right to me as long as the data is actually in there. Let me know!
  5. thank you very much, i had found this example: http://www.jqueryload.com/examples/menu/# that is exactly what I wanted, a tab to pull down a menu that stays highlighted.
  6. Hello there, I'm trying to make a tab list with a dropdown menu. Basically, I want one tab, which I already have, so when it is clicked, it's background color changes and a menu drops down, while the menu is dropped, the tab stays highlighted. I've looked at many tutorials that have something similar to this, but not exact. Even something basic would be nice, like say when your on your facebook account, and you click your notification button, the background of the icons turns white to match the dropdown box, but the tab stays highlighted until you click off of this. I have already done something like this, using a tutorial, but I have way too much excess CSS and javascript, I believe there is an easier way to do this. To view an example of what I have already, you can go to http://zext.org and login under the test account, username and password is test, and click your username, you'll see exactly what I'm talking about. Sorry for the sloppy explanation, but I think I got my point across, if anybody needs anymore information, feel free to ask.
  7. What do you mean exactly? the s. f. and u.? I thought those were needed? If that is not what you're talking about the please be more elaborate.
  8. Sorry for the bump but I had thought the issue was resolved, it seems the code is doing this once more and it's quite a bother, it's making this an issue with parsing my html properly somehow. help is still needed for anybody willing to take a look. It seems the issue is with google chrome! In firefox divs aren't automatically added, but in google chrome they are, what can I do about this?
  9. So I just restarded XAMPP and it now does not create divs, so I guess this is solved.
  10. I have a rich text editor that I use for my site which was working just fine for me last night. Now I'm not sure what happened but all of a sudden it started adding div tags by default which I do not understand in the slightest. I'm assuming it is the rich text editor doing this, because when I replaced the javascript that calls the textarea with actual html, <textarea name='text'></text> it does not automatically add <div> or <br>, but when I use my code it goes ahead and does it. here is a link to the source of my text editor: http://zext.org/templates/default/scripts/richtext.js this is the html I use to call the edtior, which worked fine until yesterday: <script language="JavaScript">function submitForm() { updateRTEs(); return true; }</script> <form onSubmit="return submitForm();" method="post" enctype="multipart/form-data" action=""> <script language="JavaScript" type="text/javascript" src="templates/<#TEMPLATE#>/scripts/richtext.js"></script> <script language="JavaScript" type="text/javascript">initRTE("templates/<#TEMPLATE#>/images/bbcode/", "templates/<#TEMPLATE#>/rte/", false); </script> <table class="main" cellspacing="1" cellpadding="8"> <col width="25%"><col width="75%"> <tr class="head"><td colspan="5">› Editing Content</td></tr> <tr> <td class='row2' valign="top"> <div class='smiley_wrap' style='border: solid 1px #e1e1e1; padding: 5px; margin: 5px;background: #fff; width: 150px;text-align:center;float:right;'> <script type='text/javascript'>writeRichText('textarea', 'emoticons', '{$smilies}');</script> </div> </td> <td class='row1'> <table cellspacing="0" cellpadding="0"> <tr> <td> <table class="rte" cellspacing="1" cellpadding="2"> <tr class="rte_head"> <td><script type="text/javascript">writeRichText("textarea", "bbcode", "", 1);</script></td> </tr> <tr class="row1"> <td><script type='text/javascript'>writeRichText('textarea', 'textarea', '', '', '0', '$text', 400, 200);</script></td> </tr> </table> </td> </tr> </table> </td> </tr> I'm not sure why it's doing this or what happened to make it do this in the first place. Like I said it was working fine last night, I powered off my comp, turned it back on and now it's not working. Also yes, I've made sure <#TEMPLATE#> is properly replaced and that the directory for the source is loaded properly. Any ideas will be much appreciated. Thanks, Matt.
  11. Hello all, I have a forum script for my website, and the way I count the users viewing each forum is not to my satisfactory. My query pulls all the categories and renders their data inside the foreach() loop, but to count the users viewing each category, I use another query inside the loop to grab the session data which has the users referrer, which is how i determine the users viewing the category. So the loop pulls out about 7 categorys, and runs a query for each category, increase my query count and load times, I'd like to see about counting the users viewing each forum in the main category, but that is what I'm having issues with. I've tried to do it on my own, but the farthest I've gotten is that the script only shows the forums that users are viewing, so I think. This is because I'm developing on my localhost, and since nobody else is online but me, there is no way I can actually tell. Let me show you the queries I use: of course the code will be simplified for better understanding <?php $categories = $this->zext->db->get_table("SELECT f.fid AS fid, u.id as lastpost_author_id, f.name, f.description, f.parent, f.replies, f.topics, f.postable, f.redirecturl, f.redirect_hits, f.perms, f.is_news, f.lastpost_id, f.lastpost_time, f.lastpost_title, f.lastpost_author_id FROM lnx_forums AS f LEFT JOIN lnx_users AS u ON f.lastpost_author_id=u.id ORDER BY f.sort ASC"); foreach ($categories AS $category) { $viewing = count($this->zext->db->get_table("SELECT f.fid, f.name, f.parent, s.sid, s.referrer, s.user_id, u.id AS uid, u.username, u.group_id FROM lnx_forums AS f LEFT JOIN lnx_sessions AS s ON f.fid = (SUBSTRING_INDEX((SUBSTRING_INDEX(s.referrer, 'fid=', -1)), '&', 1)) AND (SUBSTRING_INDEX(s.referrer, '&', 1)) = 'mod=forum' LEFT JOIN lnx_users AS u ON u.id = s.user_id WHERE f.fid = '{$category['fid']}' AND f.postable = 1")); } ?> I guess I'm wanting to left join the session table into the main query and use mysql's count function to count the rows of the viewing users? I'm just stumped, I don't get any sql errors I just return 0 rows everytime. Any help will be gladly appreciated. Thanks, Matt. I've tried just a basic query like so: SELECT f.fid AS fid, u.id as lastpost_author_id, f.name, f.description, f.parent, f.replies, f.topics, f.postable, f.redirecturl, f.redirect_hits, f.perms, f.is_news, f.lastpost_id, f.lastpost_time, f.lastpost_title, f.lastpost_author_id, count(s.sid) AS viewing, s.referrer, s.user_id FROM lnx_sessions AS s LEFT JOIN lnx_forums AS f LEFT JOIN lnx_users AS u ON f.lastpost_author_id=u.id ORDER BY f.sort ASC and I get an sql error: #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 'ORDER BY f.sort ASC LIMIT 0, 30' at line 1
  12. i figured 3 days is an appropriate wait to bump this topic. i still need help with this if anybody has any ideas, thanks.
  13. What do you mean exactly? The $inside variable only gets set when tag is used, so how would it effect the rest of the script?
  14. the regex works or else the links wouldn't parse in the first place. example of the code working and not working can be found here: http://zext.org/index.php?mod=roadmap&func=view&id=26 the issue is that when i space it out, my code creates a <br> tag, the tag gets encoded with htmlspecialchars which makes it <br> so it submits the data into the db like, text<br><br>http://zext.org, since the url is not spaced after the > the link does not get parsed, when i manually add the space in from phpmyadmin the link gets created, so the regex works, just not when the url is after <br> anyway, thanks for trying to help, that is more than i can ask for. anybody else have any ideas?
  15. Yes I have done this. I also didn't answer your previous question, the method responsible is parse_message, when data is inserted into the database the text is sanitised with htmlspecialchars(), and it get's decoded with html_entity_decode, what i posted above is the how the text looks once encoded, and the link to the site that shows the links unparsed is how it looks decoded. I've also tried with htmlspecialchars_decode and that doesn't seem to resolve the issue either. It's just strange, I didn't think that a simple space would be the issue, since the content is properly decoded. Any other ideas on why this may be happening?
  16. I understand globals should not be used with OOP, thank you kindly for that, once I have a proper instance created I'll get rid of that, that is currently not my issue. it actually seems that my capture input function is what is dealing the damage here, because when i checked the text in the database, it looks like this: test<br><br>http://zext.org<br><br>www.zext.org<br><br>http://www.zext.org <br> That is how it's submitted into the database, it seems there is something wrong with my code that is parsing it, so it's something to do with $message = html_entity_decode($message); maybe? I'm not exactly sure why the link will not parse with the >http://zext.org, because it transforms it back, because if i add a space after the > manually from the database it parses the link correctly, any idea why?
  17. Hello guys. I've encountered a strange problem where my post parser class will not properly parse links. What I mean is, if you type, www.website.com, http://website.com, it should automatically make those links click-able. Well, it does do that, to a certain extent. If I hit enter and start a new line with the website, like this: http://site.com It will not parse the links, but if I have the url in mid sentence, it will parse it no problem. here is the link to my entire parsing script: http://pastebin.com/GaSeL4rR here is a better example of what I mean: http://zext.org/index.php?mod=roadmap&func=view&id=26 Any help at all would be greatly appreciated, I have no idea why the script is doing this, or how. Thanks in advance, Matt.
  18. never mind guys. this was an issue with the user table retrieving the serialized array, please mark this topic as solved.
  19. Is that a dump of $privacy or $privacy["privacy"]? sorry, it's dump of privacy['privacy']. @darkfreaks, i can try it, but i'm more worried about how my script stopped working out of nowhere. the if statement is correct and there aren't any errors, so why would it work one day and not the other? I've tested this on zext.org which is the main website, and also on my localhost. zext.org has had the same code and has not been altered and that is where i found the issue. i've cleared my browser cache and what not and it's still doing it, why would it do this? how?
  20. So on my website I have a basic if statement that checks some arguments to see if a user can add another user as a friend. Well I had gotten that part down and for the longest time other people on my website have been able to use the feature. Now all of a sudden the if statement doesn't work? Why? Here is the statement: if ($privacy['privacy']['who_can_add'] == '1' AND $zext->user['id'] != '0' AND $zext->user['id'] != $u['id']) { $add_friend = $u['add_friend']; } of course if I put $add_friend outside the if statement, the button appears. How can a statment work one day but not the other? Is it an issue with my server? dump of $privacy: $ => Array (4) ( | ['hide_o_status'] = Integer(1) 0 | ['who_can_view'] = Integer(1) 1 | ['who_can_add'] = Integer(1) 1 | ['who_can_contact'] = Integer(1) 1 ) dump of $zext->user['id']: $ = String(2) "10" dump of $u['id']: $ = String(2) "4" it all has correct information and the if statement has not been changed from before when it had worked and outputted $add_friend all day long. it worked until last night, i don't know what happened or why, php version has not been changed or anything. if anybody has any ideas on what's going on help would be much appreciated. Thanks, Matt.
  21. Since there is no edit button for me for some strange reason and it seems I don't have the ability to mark topic as solved I can't do it myself. Sorry for the double post, but if any mod or something wants to mark this topic as solved feel free to do so for i have fixed the issue. Thanks, Matt.
  22. Hello All, I'm making a networking script for my cms to allow users to befriend each other, I've got adding each other as friends down, that is no longer an issue. My issue is displaying friends on a profile page. Say Matt added Frank, and frank accepted the request, well on Matts page it'll show frank as a friend, but on franks page it won't show Matt as a friend. My MySQL table has just 4 Rows id | user_id | friend_id | approved -id is a primary unique key -user_id is who sent the reuqest -friend_id is the id of the user the request was sent to -approved is the status, 0 for no accepted, 1 for accepted. On the user profile page, this is the sql query used to generate the friends list $friends = $db->get_table("SELECT * FROM zxt_friends WHERE user_id = '{$u['id']}' AND approved = '1'"); foreach ($friends AS $friend) { $friend['friend_name'] =$zext->user_cache[$friend['friend_id']]['username']; $avatar = $zext->user_cache[$friend['friend_id']]['avatar']; $friend_html = $friend['friend_name'].$avatar; } Before I tried using a different sql query, it looked like this: $friends = $db->get_table("SELECT * FROM zxt_friends WHERE user_id = '{$u['id']}' OR friend_id = '{$u['id']}' AND approved = '1'"); But the approved status was ignored, and it was all kinds of messed up, on my page it would show that Matt is indeed friends with frank, and a member that had not approved the reuqest yet, and on Frank's page it showed that he was a friend with himself when that wasn't even the case. I've looked at array_push but I can't seem to figure out the query or what I need to add the the loop, any help would be much appreciated. Thanks, Matt.
  23. Yes but how would I go about doing the merge? In the foreach loop where I determine the spiders, would I make an if statement asking if the bot name == the bot name then i would merge the array? I understand reluctance for people providing others with code, because this website is intended to help people learn, not give them their own code. But like I said, I'm having trouble getting to understand exactly how to prepare the if statement that will perform the merge, your answer was quite vague, can I have a bit more detail please? Thanks, Matt
×
×
  • 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.