wittmania (@wittmania)

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 59 total)
  • @wittmania

    Member

    Update: Somebody asked me how to add a name (instead of just the e-mail address) to the new message received e-mail notification. To do this, just use this format:

    $admin_email = "Your Name <you@yourdomain.com>";

    When the e-mail is delivered, it will show up as being from “Your Name” and not “you@yourdomain.com”. I’m not sure that this will work on all PHP configurations, but it works on mine.

    In reply to: Plugin: bb-Topic-Views

    @wittmania

    Member

    I’m open to suggestions… since it’s not part of the $topic global, but rather in the topicmeta table, that’s the only way I could think to do it.

    It works as it is, but if you’ve got a better idea as to how it could work better, I’m all ears.

    In reply to: Plugin: bb-Topic-Views

    @wittmania

    Member

    OK… it is now available through the plugin browser!

    In reply to: Plugin: bb-Topic-Views

    @wittmania

    Member

    Version 1.5 is now available here. Some of the changes:

    • Made major modifications to the internal architecture of how the plugin works, including putting several repeated tasks into functions, based on the hacks listed above.
    • Added separate function calls that makes it possible to show an unformatted view count, a list of most viewed topics, and a table of most viewed topics.
    • Improved documentation to explain how to modify tables on front/forum/tags pages to use the show_view_count() function.

    This plugin will also be available in the plugin browser just as soon as the submission gets approved.

    @wittmania

    Member

    Fel, great work as usual. I just implemented your original hack (with a few minor mods of my own) on the team blog I just started last week. It is my first attempt at a bbpress-as-comments install, and it is working very well so far. This hack adds the extra comment visibility I was missing.

    Keep up the good work.

    In reply to: WordPress and PHPBB

    @wittmania

    Member

    I second that motion… Obviously, on a bbpress board you’re going to get the home team’s opinion that bbpress is great. But, I was a former phpbb-er and I made the switch because I was tired of all of the security holes and spam in phpbb. If you like WordPress (and are proficient enough with PHP to manage a blog), you’ll LOVE bbpress. Plus, with all of the momentum it is gaining, bbpress just keeps getting better.

    In reply to: Plugin: Move It

    @wittmania

    Member

    Meanwhile, just post it on a page on your site, and put a link here…

    @wittmania

    Member

    The reason that happened is that the user roles are stored in a separate table. If it is an integrated site, they are in wp_usermeta (or bb_usermeta if not integrated) where the meta_key is bb_capabilites and the meta_value is the capabilities assigned to them. I have no idea what the syntax for these capabilities is. However, if you wanted you could go into the database and search for the user ID that you are changing, and just change it there. Otherwise, reassigning the role might be just as easy, though it will still leave the record in the usermeta DB for that ID number, which might cause some problems. Unfortunately, there just isn’t an easy way to do this. :(

    In reply to: Include code in posts

    @wittmania

    Member

    Trent uses if (bb_current_user_can('administrate')) in his YouTube plugin. Couldn’t you mod the allow_images plugin to also allow <script> tags, but only if the user is an administrator? That would still allow the scripts to do their thing, but only in posts authored by an administrator.

    Unfortunately, if you’re looking for a way to place ads in posts by any ol’ user, there’s not a safe way to do that b/c they could put ANY script in and have it execute.

    Best bet? bb-Ads. Situations just like this are what I wrote it for. You can see it in action at blog.wittmania.com/bbpress

    @wittmania

    Member

    Answered my own questions. Thanks to plenty of googling, I learned that I needed to use the cast() function to consider the values as numbers instead of as text strings.

    This is the code I ended up with:

    $most_viewed = (array) $bbdb->get_results("SELECT topic_id, meta_value FROM $bbdb->topicmeta WHERE meta_key='views' ORDER BY cast(meta_value as UNSIGNED) DESC");

    The cast($column as $type) function forces the query to treat the meta_value values as unsigned integers. Nifty, yes?

    In reply to: Plugin: bb-Topic-Views

    @wittmania

    Member

    I haven’t tested this yet, but it looks like the mods that fel64 and Sam have proposed here should work. So, instead of rushing a new version of the plugin out today, I think I’ll just save these changes (and some other functionality I’m working on) for the next major release. Hopefully I can get a new version of it out in the next couple of weeks.

    In reply to: Plugin: bb-Topic-Views

    @wittmania

    Member

    @fel, Hack away… I’d be interested in seeing the code so I could incorporate it in the next version of the plugin. If you’re willing, please e-mail it to me at mike at wittmania dot com.

    Thanks!

    In reply to: Plugin: bb-Topic-Views

    @wittmania

    Member

    @Sam, I use your excellent Page Links plugin, and I wrote mine specifically to be compatible with yours. In fact, I wouldn’t have known what filter to use if it weren’t for your plugin.

    I set the priority of my filter as 99 (yours is set to 100), so it fires directly before yours. Also, my plugin checks to see if the page_links_add_links function exists, and if it does it automatically drops the page links to a new line below the title in order to make things a little more sightly.

    @smurfdude, I thought about that, too. I initially decided against that route so I could have it function without having to edit any template files. The way it works right now is that it is inserted with a filter that is triggered when (and where) the topic title is fed to the page. If you’re feeling really ambitious, you can go into bb-topic-views.php to see how the mechanics of the plugin work. From there, you could change some things around so you could put the views count in its own column. Eventually I may add that functionality within the plugin, but that’s not a high priority right now.

    Speaking of priorities, the next to-do on my list is to add functionality where a user can add a template tag that will display the top 5 (or 10, or whatever) most viewed posts, either as <li> items so you can use it anywhere, or in a format similar to the way the Latest Discussion area is laid out. Stay tuned…

    In reply to: Topic views

    @wittmania

    Member

    Your wish is my command…

    https://bbpress.org/forums/topic/1121

    @wittmania

    Member

    Got it figured out! I studied up on how to use session variables, and that gave me the answer I was looking for. By passing the “last topic ID” variable, I could check to see if it matched the “current topic ID” variable. If it matches, it leaves the record alone. If it’s different, it adds a tick to the counter.

    The post for the completed plugin is here:

    https://bbpress.org/forums/topic/1121

    In reply to: Plugin: BB-Ads

    @wittmania

    Member

    I have launched an “Area 51” forum to test and display the effects of my plugins. You can see bb-Ads in action here:

    http://blog.wittmania.com/bbpress/

    Also, I have now tested this plugin with pretty links, and it does work. The only changes to be made in the coding as given in ad1.php is that you have to delete the .php from the strpos check. This will just look for the words in the link instead of the actual .php file names.

    In reply to: Plugin: bbPortal 1.2

    @wittmania

    Member

    I’m sorry if this has been covered somewhere…

    What exactly does this plugin do? Do you have any screenshots, or a site where it is working?

    Thanks!

    In reply to: Plugin: BB-Ads

    @wittmania

    Member

    UPDATE: The sample ad file now includes the code necessary to display different ads based on the context. For example, if it is a topics page, it will display one ad and if it is a forum page, it will display a different one.

    The code is something like this:

    <?php
    if ( strpos($_SERVER['REQUEST_URI'], 'topic.php') ) { ?>
    <div>An ad for a topics/posts page</div>
    <?php
    } elseif { another specific page;
    } else { default ad;
    } ?>

    The sample file includes elseif checks for topic.php, forum.php, profile.php, and a “default” if none of the above pages are detected.

    This would allow you to have one file per sponsor/advertiser, with a different context-based ad for each situation.

    In reply to: Plugin: BB-Ads

    @wittmania

    Member

    Screenshots here:

    An ad between posts on a topic page:

    http://www.wittmania.com/images/bb-ads-1.gif

    An ad on the front page, text-only (w/ CSS):

    http://www.wittmania.com/images/bb-ads-2.gif

    An ad on a Forum page, with an image in it:

    http://www.wittmania.com/images/bb-ads-3.gif

    I don’t have it up and running on my own forum yet b/c I am still building the ads for it. I haven’t submitted it yet, but I’ll look into how to do that right away.

    In reply to: WP-Ads

    @wittmania

    Member

    Version 0.1 of BB-Ads is now available.

    https://bbpress.org/forums/topic/1024?replies=1

    Necessity is the mother of all invention.

    In reply to: WP-Ads

    @wittmania

    Member

    Trent, I had used an image rotating script somewhere awhile back that would serve a random image file from a specified folder. I would guess you could do the same thing to serve an html or php file from within a specified folder.

    I will work on hacking that up to work as a plugin, if possible. I’ll let you know how it goes!

    @wittmania

    Member

    Yes, I suppose that’s worth noting… the instructions I left above have been tested WITHOUT the avatar plugin running. From what others have said, these two plugins don’t play nice together.

    In reply to: adityanaik.com

    @wittmania

    Member

    I dig the site, so1o. How did you get the tags in order by size instead of alphabetically?

    In reply to: RBForums

    @wittmania

    Member

    I like the look, esp. the red/green lights on support topics.

    The first link in your nav menu is broken… might want to check on that. Also, I might suggest a different background (not the same one used here) that would fit a little bit better with the rest of the design from your site.

    Nice work, wmarcy. A good bbp site, for sure.

    @wittmania

    Member

    I assume you mean on a topics/posts page. Find post.php, and insert this code wherever you want the name/profile link:

    <a href="<?php _e(attribute_escape
    (get_user_profile_link
    (get_post_author_id()))); ?>">
    <?php _e(get_post_author()); ?></a>

    I broke it up into several lines for easier reading here, but it should all be on one line. This will build the profile link using the post author’s name as the text for the link.

Viewing 25 replies - 1 through 25 (of 59 total)