Search Results for 'code'
-
Search Results
-
Topic: Plugin: bb-Topic-Views
bb-Topic-Views keeps track of how many times each topic has been viewed, and then displays the count alongside the title of the topic on the front page, on forums pages, and on tags pages.
The plugin is written in such a way that it does not double-count views when a visitor browses to a different page in the same topic. If no view count record exists for a specific topic, the plugin will create a record for it. Rather than setting the initial view count to zero, the plugin sets it to the number of posts in the topic, because it has obviously been viewed at least as many times as people have posted in it! This is especially nice for adding the plugin to existing bbpress forums so the view count isn’t zero for every single topic.
You can download it here: http://blog.wittmania.com/bb-topic-views
You can see it in action here: http://blog.wittmania.com/bbpress
—
By the way, I’ve only tested this plugin in browser environments where cookies were enabled. This plugin doesn’t set any cookies (directly, anyway), but it does use session variables which are usually passed as cookies. So, if anyone runs into any bugs, please let me know!
I’m also very open to suggestions as to how I could streamline or improve the code. Thanks!
Topic: Views plugin help needed
I am working on a “Topic Views Count” plugin, and I’m just about finished with it. You can see a working version of it here: http://blog.wittmania.com/bbpress/, and see the source code as it is right now here: http://blog.wittmania.com/files/bb-topic-views.txt
The only thing holding me up is this; I can’t figure out a way to keep the views count from including page views. For example, when page one of a topic loads, the view count will go up by one. But, when page two loads it will also go up by one. So, a visitor has only viewed the topic once (albeit they’ve viewed more than one page), but the counter has registered two views).
I know this isn’t a huge deal, and a counter that over-counts is better than no counter at all. Still, I was wondering if anyone would have any ideas. I’d like to avoid using cookies, if possible, because I have no experience with them at all to even know where to start.
Any ideas? I’m also open to any other ideas or suggestions for the rest of the code.
Thanks!
Topic: MathML and BBpress
Ok, I’ve been poking around the forums, found out how to get new allowed tags (thanks to Louise Dade + others) and now want to add MathML tag support, so users can post MathML.
A big problem is that the editor box seems to add line break
<br />
tags to every line – how do you turn this off?The array I’m using in the plugin is:
`$tags = array(
// XHTML elements:
'a' => array(
'href' => array(),
'hreflang' => array(),
'title' => array(),
'rel' => array(),
'xml:lang' => array()),
'abbr' => array('title' => array()),
'acronym' => array('title' => array()),
'b' => array(),
'bdo' => array(
'dir' => array(),
'xml:lang' => array()),
'blockquote' => array('cite' => array()),
'br' => array(),
'code' => array(),
// 'del' => array('datetime' => array()),
'dd' => array(),
'dl' => array(),
'div' => array(
'dir' => array(),
'xml:lang' => array()),
'dt' => array(),
'em' => array(),
'i' => array(
'dir' => array(),
'xml:lang' => array()),
// 'ins' => array('datetime' => array(), 'cite' => array()),
'li' => array(),
'ol' => array(),
'p' => array(),
'pre' => array(),
// 'q' => array(),
// 'strike' => array(),
'span' => array(
'dir' => array(),
'xml:lang' => array()),
'strong' => array(),
'sub' => array(),
'sup' => array(),
'u' => array(),
'ul' => array(),
// MathML elements:
'math' => array(
'xmlns' => array(),
'mode' => array()),
'mo' => array(
'lspace' => array(),
'rspace' => array(),
'fence' => array(),
'separator' => array()),
'mi' => array('mathvariant' => array()),
'msub' => array(),
'msup' => array(),
'msubsup' => array(),
'mfrac' => array('linethickness' => array()),
'mn' => array(),
'mstyle' => array(
'scriptlevel' => array(),
'fontstyle' => array(),
'fontweight' => array(),
'mathvariant' => array(),
'displaystyle' => array()),
'mtext' => array(),
'mspace' => array(
'width' => array(),
'height' => array(),
'depth' => array()),
'msqrt' => array(),
'mmultiscripts' => array(),
'mprescripts' => array(),
'none' => array(),
'mroot' => array(),
'mphantom' => array(),
'merror' => array(),
'mover' => array(),
'munder' => array(),
'munderover' => array(),
'maction' => array(
'actiontype' => array(),
'other' => array(),
'selection' => array()),
'mtable' => array(
'align' => array(),
'columnalign' => array(),
'rowalign' => array(),
'equalrows' => array(),
'equalcolumns' => array(),
'columnspacing' => array(),
'rowspacing' => array(),
'columnlines' => array(),
'rowlines' => array(),
'frame' => array()),
'mrow' => array(
'xlink:type' => array(),
'xlink:show' => array(),
'xlink:href' => array()),
'mtr' => array(
'rowalign' => array(),
'columnalign' => array()),
'mtd' => array(
'rowspan' => array(),
'columnspan' => array(),
'rowalign' => array(),
'columnalign' => array()),
'mpadded' => array('width' => array())
);
return $tags;
}`
If anyone’s interested, you can find install at http://www.thetelegraphic.com/bbpress/bbpress/ (for now, once it’s fully working it’ll go to a dedicated domain).
Topic: Profile Tabs
How do you add a tab to the three tabs – “Profile”, “Edit” and “Favourites” – visible only in the profile? I want to add a tab for the avatar and am fairly sure there’s a hook
bb_profile_menu
but I’m not sure what to do with it. The API certainly supports adding them, the code’s there, but I’m not sure how to do it. Anyone know?Hi!
I did the installation as guided… created a config file…
So after the creation of a config file, and I reload the page, nothing shows but blank… a big white blank page.
I get this messege in my apache error log:
[error] [client 127.0.0.1] PHP Fatal error: Call to undefined function __() in C:\wow1.11\www\bbpress\bb-settings.php on line 7
Thx for all the help I can get!