77 2007-06-01 13:56
Topic: Problem with MySQL query (8 replies, posted in PunBB 1.2 troubleshooting)
The following query in viewtopic.php (That I have modified myself, and has been modified by a couple mods installed) seems to be using a lot of CPU, and taking over 2secs to execute, which seems very slow to me compared with normal MySQL queries.
I was wondering if anyone has any suggestions as to what part is causing the problems, or even a way to fix them. Thanks
$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting,
u.num_posts, u.registered, u.admin_note, u.adult_sig, SUM(r.rep_plus) AS count_rep_plus, SUM(r.rep_minus) AS
count_rep_minus, u.reputation_enable, u.awards, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email,
p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_title, g.g_user_title, g.g_link_color,
g.g_hover_color, o.user_id AS is_online, b.id AS b_id, b.message AS b_message, b.expire AS b_expire, b.banned_by
AS b_by FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN
'.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1
AND o.idle=0) LEFT JOIN '.$db->prefix.'bans AS b ON b.username=u.username LEFT JOIN '.$db->prefix.'reputation as r
ON (r.user_id=u.id) WHERE p.topic_id='.$id.' GROUP BY p.id ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'],
true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
PS. Not sure if this is the correct board since its not a clean PunBB install, please move if necessary.
78 2007-05-03 06:10
Re: ? how to use $db->* (5 replies, posted in PunBB 1.2 modifications, plugins and integrations)
take a look in include/mysql/mysql.php (i think the folder is something like that, can't remember off the top of my head).
79 2007-04-14 21:52
Re: AV scanning uploaded images (5 replies, posted in Programming)
What you could do is just set a cronjob to scan your uploaded files once a day
To be honest, I think that would be worse, and you'd be rescanning files you already scanned. Unless of course you make it note new files and only scan those, but I still would think scanning at all is overkill.
80 2007-04-14 13:52
Re: AV scanning uploaded images (5 replies, posted in Programming)
Personally, I wouldn't bother.
81 2007-04-13 14:29
Re: any gamers here? (16 replies, posted in General discussion)
Im not hugely into gaming, though I did just splash out on a nice new PC (Asus Commando, Core 2 Duo E6600, Geforce 8800 GTX, 2Gb Corsair PC6400, 74Gb WD Raptor). I play Battlefield2142 quite a bit, if your into that kinda game I would definately recommend checking it out.
82 2007-04-13 14:25
Re: Add More Users? (25 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Isn't it kinda lame to fake the amount of users you have though? I can't see any point other than trying to trick people into thinking a site is more popular than it actually is.
83 2007-04-11 16:46
Re: PunBB 1.2.15 (98 replies, posted in News)
Urgh my forum is heavily modded, im too lazy these days
Thanks for the update
84 2007-02-28 17:57
Topic: Suggestions needed - announcement emailing (0 replies, posted in PunBB 1.2 discussion)
I have an announcement mod installed on my forums, that flags specific boards to be announcement boards - any posts in them being exported to the portal and rss feeds. However I was wanting to automatically email a copy of any posts in these boards to members, to alert them of new announcements/news (obviously having un-subscribe options & what not, the aim is to inform not to spam).
Writing the mod wouldn't be any problem, however I could do with some help designing it - My forums have over 3000 members = 3000 emails per announcement (announcements aren't regular, 1 or 2 a week at tops). Obviously though sending 3000 emails in a simple loop is not going to go down well with the mail server. Not surprisingly actually my host's TOS states you can send a max of 200 emails an hour.
One solution that came to mind would be a email queue and some kind of script on crontab to send 100 or so every hour, but that seems kinda messy, and I'm pretty sure the host wouldn't be too happy with it, even if it is within the TOS.
Would simply using a SMTP server hosted elsewhere for my emailing be alright? Or would sending 3000+ requests to the external mail server still be a bit much? (My knowledge around email is fairly limited, it's not something I've had to deal with before.)
PS. I'm not sure if this is the best board for this, the context is PunBB but the question and problem themselves aren't - feel free to move.
85 2007-02-14 13:39
Topic: Stats Mod v1.0 (0 replies, posted in PunBB 1.2 modifications, plugins and integrations)
This mod adds a statistics module to your forums.
This mod requires adding a crontab, for extra help on this please see the documentation for your hostings control panel.
If you would like to see an example of this mod in action, you can do so at http://www.syi.cc/stats.php.
Please get the mod from PunRes.org: http://www.punres.org/desc.php?pid=352
The main reason I'm posting this here is because feedback would be great. I wrote this a week or 2 ago and only just got around to writing a readme for it and packaging it up to release. To be honest I have not tested the package, so I'm hoping I didn't forget anything.
86 2007-02-05 18:03
Re: (Reputation mod) HELP, HELP, HELP! :) (5 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Assuming your using the same mod which I've seen before, the answer is no.
87 2007-01-28 01:25
Re: BBCode Bug. (2 replies, posted in PunBB 1.2 bug reports)
Quick fix - move the url parsing to the top of the array so it parses it last.
88 2007-01-27 23:37
Re: tips for a new Ubuntu/*nix user? (5 replies, posted in General discussion)
UbuntuForums are really useful, and its members are very helpful: http://www.ubuntuforums.org/
UbuntuGuide has a very good wiki for Edgy (Codename for 6.10): http://ubuntuguide.org/wiki/Ubuntu_Edgy
89 2007-01-08 23:45
Re: Basic syntax colouring with line numbers (10 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Given up on this ):
Found a much nicer one already made so decided to use that, ive requested this thread be locked/deleted.
90 2007-01-08 21:02
Re: [HTML output] "<b>" rendering problem (8 replies, posted in PunBB 1.2 troubleshooting)
Can we have a link to where this is happening?
91 2007-01-08 18:12
Re: Basic syntax colouring with line numbers (10 replies, posted in PunBB 1.2 modifications, plugins and integrations)
They're working in IE7. And in IE6.
Yeh i sorted it, just had change FF to use outside too and set a left margin so they came out from under the div.
92 2007-01-08 17:19
Re: Basic syntax colouring with line numbers (10 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Damnit, I just noticed the line numbers aren't working at all in IE... Any suggestions why not? It's just an ordered list with decimal list style :s
Edit: Nevermind, IE was ignoring the inside command, and putting the numbers outside the list (ie. under the containing div).
93 2007-01-08 16:53
Re: Basic syntax colouring with line numbers (10 replies, posted in PunBB 1.2 modifications, plugins and integrations)
\b$keyword\b will match the keywords correctly
Thank you (:
94 2007-01-08 15:10
Topic: Basic syntax colouring with line numbers (10 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Firstly, i realise there are a bunch of syntax colouring mods out there, but I like to make my own mods instead, i like to know exactly how things work and its good practice. You can see a demo, along with the instructions here: http://www.syi.cc/viewtopic.php?pid=521483#p521483
I am not properly releasing this mod yet, as it has afew things in it I would like to get sorted first.
- Escape characters are not handled properly within strings, for example in line 20 in the first code tag.
'/(\'.*\')/U'
This of course should be continuously coloured, as the whole thing is ment to be a string.
- If the line is too long, it pushes onto the next line, eg.
01.
$text .= '</p><div class="codebox"><div class="incqbox"><h4>'.$lang_common['Code'].':</h4><div>'."\n".parse_code($inside[$i])."\n".'</div></div></div><p>';
- Keywords are highlighted even if part of a word. Eg:
$newly
I assume in regex there must be an easy enough way to specify it must not be surounded by alphanumeric chars? Ill look into it later on, as I said, my regex isn't top.
- I would like to have the current line being hovered over highlighted. This is simple enough for FF, as you can use li:hover in css. However in IE :hover is only defined for a tags, with a href property. Is there some way around this?
Really I am posting this, hoping for some help fixing these problems, to be fair I haven't actually tackled either properly yet, but my regex knowledge isn't amazing (for the first one is there some way to say the ending tag must not be followed by a \?).
Any input is appreciated.
Thanks
95 2006-10-22 03:19
Re: Denial Of Service!! (7 replies, posted in PunBB 1.2 troubleshooting)
Talk to your host and see what they can figure out from the webserver logs
As a side note: how do you have a VPS without access to Apache logs?
My guess would be he ment shared hosting, but even most shared hosting allows access to apache logs for your own domains.
96 2006-10-19 16:49
Re: Internet Explorer 7 Final released (20 replies, posted in General discussion)
97 2006-10-16 11:34
Re: PunBB 1.2.14 (95 replies, posted in News)
Don't forget to clear the cache folder aswell so the config updates.
98 2006-10-11 15:55
Re: Postcount still the same after deleting a post (3 replies, posted in PunBB 1.2 troubleshooting)
It's not a bug, the post count counts how many times the user has posted, not how many posts currently exist by them.
99 2006-10-10 10:15
Re: Redirecting Bug (5 replies, posted in PunBB 1.2 troubleshooting)
You sure it's not the hosting your using? Never heard of it myself.
100 2006-10-09 19:14
Re: Delete Topic Bug! (3 replies, posted in PunBB 1.2 troubleshooting)
Did you manually delete anything from the database?