Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,226 through 30,250 (of 32,426 total)
  • Author
    Search Results
  • #57381
    migpilot
    Member

    Hey fel64, I might get lynched if I drop off posts… quite a bit of great stuff there.

    My import is up to around 30,000KiB, so that’s not the issue….

    My SQL mojo man is AWOL, hence me coming here to look for some of the good SQL loving ;)

    #57380
    fel64
    Member

    I vaguely remember from setting up bb in localhost and trying to copy my server DB into my local MySQL that PHPMyAdmin wouldn’t take more than 16 Mb when importing. That might well be a setting that can be set somewhere, I don’t know; I can’t find it in its config file, in any case.

    Edit: my localhost version of phpMyAdmin says “Max: 16,384KiB” by the import dialog.

    To get around this if it is the problem, can you live without 1/3rd of the posts? Then you could delete them in the original database via some query and export the remaining 2/3rds. It might be better to hold out for someone with more database-mojo to come along and see if there’s a non-destructive way. :)

    #57372
    Trent Adams
    Member

    TRAC ticket created!

    https://trac.bbpress.org/ticket/645

    Trent

    #56694

    In reply to: Plugin: Avatar Upload

    LMD
    Participant

    Version 0.3 is now available for download from the plugin browser.

    Version 0.3 is not compatible with previous versions, so you will have to go through your templates and make some changes to the template functions (check the Readme file).

    New Features

    * added an ‘Avatar’ tab to the profile menu

    * added a ‘default avatar image’ option (if you don’t want to use fel64’s identicons — see previous posts in this thread).

    * can access just the avatar’s URI for use in other plugins.

    fel – how would you like me to link to the identicon’s plugin? Currently, I’m just linking to your post in this thread.

    Oh and I have hacked together an Über-Avatar plugin which pulls together the various avatar plugins into one ‘api’. It iterates through some logic based on a specified order of preference (set by the admin), checking to see if the user has specified an avatar using each plugin.

    For example:

    Order to check: avatar-upload, bb-avatar. bb-myavatars, identicon

    Has user uploaded an avatar?

    — Yes: Invoke the ‘avatar-upload’ plugin template function and break.

    — No… continue

    Has the user specified an external URL?

    — Yes, invoke ‘bb-myavatar’ template function and break.

    — No… continue

    Has the user got a Gravatar?

    — Yes, invoke ‘bb-myavatars’ template functions and break.

    — No… continue

    Has the user got an identicon?

    — Yes, invoke the same code as ‘avatar-upload’ and break.

    — No. create an identicon and then invoke the ‘avatar-upload’ code.

    It’s not perfect yet though, so no release.

    #57352

    In reply to: Plugin: Move It

    gh3
    Member

    meanwhile I wait for the svn account, i can say you that now we are on 0.11 version, i have just finished to add the upgrade topic info for both destination and original thread.

    sooner the download link… i hope :)

    #57341
    dprice
    Member

    Ah – so ridiculously easy! I’m liking BBpress more and more ;).

    I just requested code_trick to become pluggable too – hopefully that’ll happen, and soon, so I can just use a plugin and not hack at core files.

    #1815
    dprice
    Member

    Request: functions-fomatting.php code-trick() to be made pluggable.

    Reason: So parsers such as ASCIIMath can do their replacements on things in backticks. Then I can make a plugin for MathML support ;)

    #57350
    fel64
    Member

    Does that work? It should have been:

    <?php if( bb_current_user_can('administrate) ) {
    $wp_admin = 'wordpress/wp-admin/';
    echo '<a href="'.$wpadmin.'">Wordpress Admin</a>'; } ?>

    Sorry! :/

    #57349
    midnightsun
    Member

    hey,

    it doesn’t seem to be working! i’ve edited it a little

    <?php if( bb_current_user_can('administrate') {
    $wpadmin = 'wordpress/wp-admin/';
    echo '<a href="'.$wpadmin.'">Wordpress Admin</a>'; } ?>)

    #57348
    fel64
    Member

    Sure. Paste this in your HTML code somewhere:

    <?php if( bb_current_user_can('administrate) {
    $wp_admin = 'http://link.to.your/wordpress/wp-admin/';
    echo '<a href="'.$wpadmin.'">Wordpress Admin</a>'; } ?>

    #57329
    wmarcy
    Member

    Any chance you could show us the code for your admin stuff?

    #56258
    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. :(

    #57337

    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

    #57336

    In reply to: Include code in posts

    fel64
    Member

    Yeah, and that’s where it’s annoying because you can’t easily check if a given user has permissions. Might be worth a trac ticket request.

    Possibly easiest would be to attach a filter for the post being submitted, because then you can use the bb_current_user_can() function.

    #57335

    In reply to: Include code in posts

    Null
    Member

    Well this doesn’t adress ads only, the question is more that the admin have more rights (like javascript/html entries) then ‘normal’ users.

    Can be done let me think…………….

    – You’ll have to enter some new tags in the plugin (allowed tags)

    – Then in the template files containing post fields, you could add the tags and make them visible for the admin only with something like: if user can edit;

    Now you can use javascript and other tags that you’ve entered and only the admin can see these links/buttons, but every1 can use them though :(

    So some filter should be added in view.php? like euuhh…

    If post is by admin, allow tags x,y,z else print as code...

    This way if a user tries to put in some javascript code it will be displayed as code and if the user is admin it will execute/display it.

    In theory :D

    #57334

    In reply to: Include code in posts

    fel64
    Member

    If you can’t edit the template and have something against the excellent bb-Ads plugin: I can’t help you, because AFAIK there’s no straightforward API function to check what a non-current user can do.

    #57340
    fel64
    Member

    Thanks!

    You can include ASCIIMathML.js in the header via plugin by this sort of code:

    `function incMathJs() {

    $url = bb_path_to_url( dirname(__FILE__) . ‘/ASCIIMathML.js’)

    echo ‘<script type=”text/javascript” src=”‘ . $url . ‘”>’;

    }

    add_action( ‘bb_head’, ‘incMathJs’ );

    Not sure when or how the JS kicks in, but perhaps that’s not necessary? Anyway, you could head over to trac and request that code_trick be made pluggable (so a plugin could overwrite it).

    #57333

    In reply to: Include code in posts

    dprice
    Member

    There is a plugin to allow the img tag, but you’d need to edit it and add a statement in saying “if admin then allowed_tags = …, else allowed_tags = …”. I’m not sure how easy that would be – anyone else have any clues?

    I’d suggest editing the template in bb-templates and adding it in manually, if you really, really want a banner ad.

    #1811

    Topic: Plugin: Say My Name

    in forum Plugins
    gh3
    Member

    Hi, this is my first post on bbPress, and it will deal with my new plugin.

    First of all I have to say that it is based on the great work by Thomas Klaiber on Post Notify plugin.

    But now let’s talk about Say My Name ( smn for friends ), this plugin will look at each post that will be posted for your nickname, and if it will find it, it will notify you by mail.

    I made this plugin because many times i saw people calling someone inside a post, and due to the dimension of the forum, the huge amount of post per day, and going on… the people called doesn’t see it.

    I have only to add that, as Thomas plugin, this one is activable by your profile, so if you have too common name like “and” “or” and going on, is better if you keep it off :)

    So that’s all, i have only to add the download link: http://www.ellequadro.net/wp-content/plugins/downloads-manager/download.php?id=6

    I hope that this plugin could be useful.

    #1810
    dprice
    Member

    Being both a web nerd and Physics student, I decided it was time for BBpress to meet up with MathML.

    Here’s the steps I took to get it crankin’:

    1. Made a copy of the default ‘kakumei’ template, then renamed the folder ‘physics’, my new template name. I then put a copy of ASCIImath.js in there. This does all the hard work.
    2. Changed the physics/header.php from:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" <?php bb_language_attributes( '1.1' ); ?>>

      to:

      <?xml version='1.0' encoding='iso-8859-1'?>
      <?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >

      <html xmlns="http://www.w3.org/1999/xhtml"
      xml:lang="en"
      xmlns:pref="http://www.w3.org/2002/Math/preference"
      pref:renderer="css">

      It’d probably still work if you didn’t bother with this step, but seeing as BBpress is making XML we may as well.

    3. Added <script type="text/javascript" src="<?php echo bb_path_to_url( dirname(__FILE__) . '/ASCIIMathML.js'); ?>"> to physics/header.php – this loads the ASCIIMathML.js javascript and does a majority of the MathML magic.
    4. Opened bb-includes/formattingfunctions.php and edited this:
      function code_trick( $text ) {
      $text = str_replace(array("rn", "r"), "n", $text);
      // $text = preg_replace("|<code>(.*?)</code>|e", "'<code>' . encodeit('$1') . '</code>'", $text);
      // $text = preg_replace("|n<code>(.*?)</code>|se", "'<pre><code>' . encodeit('$1') . '</code></pre>'", $text);
      return $text;
      }

      To turn off the backtick code replacement – this is what ASCIIMath.js does!

    That was it. I’ll zip it all up then post it up here. Ideally, it’d be better to not comment out any of the bb-include/ files – if anyone has any suggestions, let me know.

    #1809
    medden
    Member

    Is there a simple way for ONLY the administrator of the forum to be able to input embedded javascript into posts?

    She wants to include some banner ads from other companies, and getting these in the right format is turning into a real headache…..

    they are published like this…

    <img src="http://track.webgains.com/link.html?wglinkid=2995&wgcampaignid=23815&js=0" border="0" alt=""/>

    but the image plugin only allows .jpg .gif etc.

    Could that be disabled only if the ADMIN was posting the entry?

    #57328
    andersson
    Participant

    Thanks for the praise and also for the tip on the middle column. Haven’t really thought of it before but you’re probably right about that one.

    Regarding the /profiles/x it is really a simple mod. You could do it in a number of ways really, where I chose the following:

    Add a row in .htaccess steering the call to the logic:

    RewriteRule ^profiles/?$ mods/profiles-by-letter.php?id=$1 [QSA,L]

    Personally I put the logic of all mods in separate files in a mod folder and the presentation in another to keep it clean.

    The rewrite rule of .htaccess makes “x” a GET-parameter to the logic, it’s then very easy to select all members starting with letter given by “x” like so:

    SELECT * FROM bb_users WHERE user_login LIKE '$first_letter' ORDER BY user_login LIMIT $limit

    That’s it. The logic part then calls the presentation which can use the result in an array or whatever format you choose for the result.

    #57188
    fel64
    Member

    Replace D M Y with a date-formatted string of your choice. It’s quite an interesting but simple system. Each letter stands for a different type of date or time. So D is replaced by first three letters of the weekdate, M by first three of the month etc.

    This reference will tell you what letters to use to see what date outputs you get. Roll your own date format. :)

    #57327
    fel64
    Member

    You’ve got a really nice eye for the design of the site. It’s rare to see something so nicely designed and functional. :)

    The main column of games could be a bit more highlighted, though; with the strong coloured backgrounds the left colum distracts a lot. Worth it for the login form, but in my opinion not for stats.

    How did you get the /profiles/X thing to work? Haven’t tried it myself, but it would be interesting to know how much modification it took to have bb accept that – if any?

    #57331
    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?

Viewing 25 results - 30,226 through 30,250 (of 32,426 total)
Skip to toolbar