Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,276 through 30,300 (of 32,480 total)
  • Author
    Search Results
  • fel64
    Member

    I think require_once (or require, include or include_once for that matter) need a path to the file rather than a URL. A path would be like the addresses you get when you’re browsing folders on your computer. I can’t say what your path would be, but mine is /home/username/public_html/wordpress/wp-config.php. Ask your hosting provider if you don’t know what to use. :)

    It might be easier to recreate the theme anyway, if I remember rightly a fair few folks come here with problems when trying to stick bb into the WP theme like that.

    csl749
    Member

    Hi folks,

    I have WP and BB running off the same DB, integrating users etc as far as I can tell, and each working perfectly. But, following the instructions on the docs page on how to integrate WP functions so they can be called in BB, I get errors.

    I put the require_once('www.mywebsite.com/wp-blog-header.php'); at the top of the BB config.php, in the hope that the WP functions would be discovered, but each time I try to add, say, a line to front-page.php like get_header or get_footer, to visually sandwich BB inside my WP header/footer, I get an error:

    Fatal error: Call to undefined function: get_header() in /home/csleary/public_html/forum/my-templates/lemodie/front-page.php on line 1

    I’m very much a novice with all this, so I’m just following instructions at the moment hoping things will work. But as far as I can tell I’ve done everything correctly – please may someone offer some ideas as to what’s going wrong? While searching other integration threads, I came across one that said to make sure WP was loaded first, so BB could then load the functions, but I don’t know how to ensure this. BB is currently in siteroot/forum, and wordpress is in the root dir itself.

    Any help would be fantastic, thanks.

    #57384
    chrishajer
    Participant

    Can you do it from a command line rather than a web interface to avoid the upload problem?

    Can you upload the file and then do something like this on the command line:

    mysql -u UserName -p DBName < TheFullTargetFilePath.SQL

    -p will prompt for the password on the command line

    I imagine there’s probably a -h if you need to specify a different host too.

    #57388
    chrishajer
    Participant

    There are a couple of tricks you could use (I have no idea how it’s done officially.)

    In your site, all you would need to do is insert this into the template that contains the page navigation you have now (Home, About and Contact all appear to be pages):

    <li class="page_item"><a href="<?php bloginfo('url'); ?>/forum/" title="Visit the forum">Forum</a></li>

    HTH

    Chris

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

Viewing 25 results - 30,276 through 30,300 (of 32,480 total)
Skip to toolbar