Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 31,376 through 31,400 (of 32,462 total)
  • Author
    Search Results
  • #53505

    In reply to: Changing a Domain name

    spencerp
    Member

    Good tutorial from Podz! Seen it before, but forgot about it! Thanks for posting Spencer!

    Yep! I don’t think I could live without his guides lol! You’re welcome by the way. :) ;)

    And I just like how he uses images to show people what, and where to do things.. :D

    spencerp

    #53538
    Trent Adams
    Member

    As a note to others as well, make sure you READ the documentation for this! If you don’t run your plugins through the readme validator and correct all the errors, the plugin will not show up correctly. As well, the plugin code must be in the same format for system to create post in plugin page with the right name, author, version, etc.

    If you do make a mistake, upload a new one and the system will automatically change when it runs the script again (every hour or 2).

    Hope that helps out as well.

    Trent

    #53403

    In reply to: for each question

    ear1grey
    Member

    Just compute the computable stuff beforehand and it becomes a lot more maintainable/readable.

    // setup the basic data

    $uri=option("uri").$rw["page"];

    $class="";

    // compute the computable data

    if ($rw['is']) { $class="current" }

    // write the line

    echo "<li><a class='$current' href='$uri'>".$rw['item']."</a>"

    Note that I’ve used class rather than id for semantic purposes – the ID of an element shouldn’t change, but it’s class can change and can be multiple, so you could even do:

    $class="item";

    if ($rw['is']) { $class .=" current" }

    #53263

    In reply to: Time Format

    Null
    Member

    Ands how does one change the time from

    2007-01-16 18:23:58

    to

    January 16, 2007

    So no time, only date. I have added <?php topic_time(); ?> to my frontpage and it shows: 2007-01-16 18:23:58, but on the fronpage (only there) I want to show it like: January 16, 2007

    Thx

    #53402

    In reply to: for each question

    Null
    Member

    I did that but you can’t use php in an echo:

    <?php

    global $bbdb;

    $r = mysql_query("SELECT * FROM $bbdb->menu WHERE set = 'active' ORDER BY order ASC");

    while($rw = mysql_fetch_array($r))

    {

    echo '<li><a href="'.$rw['page'].'">'.$rw['item'].'</a></li>';

    }

    ?>

    This works perfectly, but now I want to add some php code into <a!here the php code!>...</a> so it will look like this (i only show the echo now):

    {

    echo<li><a <?php if ('.$rw['is'].')

    {

    echo "id="current"";

    }?> href="<?php option('uri'); ?>'.$rw['page'].'">'.$rw['item'].'</a></li>;

    }`

    But this aint working cause you cant do php in an echo. Any suggestions?

    #1270
    mikros
    Member

    Hi. I just got bbPress up and running this evening, and I’m really liking it so far. I have it configured for “pretty permalinks”, and I’m seeing a strange “replies” argument in the topic URLs. For instance:

    http://example.com/topic/2?replies=1

    This makes pretty permalinks not quite so pretty after all. I thought the whole idea was to minimize the arguments to be more search-engine friendly.

    After looking through the source code, it doesn’t appear that this argument is actually used for anything functional. My best guess is that “replies” is an attempt at a cache-buster, so that the URL changes each time a new reply is posted. Wouldn’t it be preferable to simply set the “Last-Modified” header to the time of the most recent post?

    It seems like this would achieve the same thing without ruining the pretty permalinks. Also, I notice that the bbpress.org support forums don’t have this extra argument. Can you share the magic?

    Thanks.

    #53533
    davidbessler
    Member

    Figured it out. Kind of dumb. $topic->forum_id

    #53532
    ardentfrost
    Member

    Your answer is in the database. Try to find it, but if you can’t, I’ll give you the answer :)

    #53466
    davidbessler
    Member

    OK. Thanks. It turned out bb_head() was only called (as part of an if () statement) when the page is a topic. So I see that my above plugin works on a topic page. Awesome.

    My long-term project is a forum-access plugin where you can grant or restrict access to individual users. Not roles-based.

    Does anyone know a hook to use for intercepting an individual forum listing in front-page.php? You’d think get_forum would work, but for some reason … anyway.

    I’ll keep you posted on my adventures of learning to write plugins.

    #53500

    In reply to: Changing a Domain name

    I cannot think of anything you’d have to do besides re-edit your config.php unless you’ve hardcoded your domain into any custom templates.

    #53499

    In reply to: Changing a Domain name

    startribe
    Member

    Is that it? I am actually working with both WordPress and bbPress integrated. There is quite alot of work that needs to be done WP on the database side ( https://codex.wordpress.org/Changing_The_Site_URL ) , so I was figuring something similar would need to be done for bbPress. Although, they are sharing a database, not sure if that makes a difference. Any other thoughts?

    #52803

    In reply to: Plugin: Summon user

    I hope you’ll continue to populate the plugins browser with your clever works :)

    https://bbpress.org/plugins/

    #53401

    In reply to: for each question

    ear1grey
    Member

    That’s very difficult to decipher, so for maintainability may I suggest you break out the code so you create variables first then use them when creating the echo statement.

    It looks like you need to use call_user_func(tabel["is"]) to run the function names that you’re retrieving from the db.

    #53400

    In reply to: for each question

    Null
    Member

    Euuhh well still can’t get it to work…

    I have the function:

    function get_bb_menu() {

    global $bbdb;

    return $bbdb->get_results("SELECT * FROM $bbdb->menu WHERE set = 'active' ORDER BY order ASC");

    }

    This will give (tabel sperated with – ):

    set – item – page – is – order

    active – Forums – index.php – is_front() – 0

    active – Statistic – statistics.php – is_bb_stats() – 1

    active – Search – search.php – is_bb_search() – 2

    Now I want this in a for each so it generates (note this is A PART what it should generate):

    <li><a <?php if (is_bb_search())

    {

    echo "id="current"";

    }?> href="<?php option('uri'); ?>search.php">Search</a></li>

    <li><a <?php if (is_bb_stats())

    {

    echo "id="current"";

    }?> href="<?php option('uri'); ?>statistics.php">Statistics</a></li>

    But how to do this???

    #53465

    davidbessler,

    Your theme needs to have a call to bb_head() in its header.php.

    If you’re using a version of the default header, make sure bb_head() is actually being executed on every page load. There was a bug in early versions of bbPress that prevented bb_head() from being called on anything but topic pages.

    As an aside, if you’re adding javascript, you should definitely use bb_enqueue_script().

    bb_enqueue_script( 'give-it-some-name', '/soruce/file.js');

    #53491

    In reply to: bbPress 0.8

    It will be longer than we thought originally :)

    We guessed too optimistically. Oops!

    #53488

    In reply to: bbPress 0.8

    Null
    Member

    Nah it will take some weeks before it’s released, so call down :D

    #53394

    In reply to: My Template

    Null
    Member

    You mean the green background when hovering?

    .notice {

    border: 2px solid #4c9545;

    background: #abd8a2;

    color: #4c9545;

    font-size: 1.1em;

    font-weight: bold;

    padding: 10px 15px;

    margin: 0 0 1.1em;

    }

    Not sure though

    #52426
    spencerp
    Member

    That is SWEET!! I’ve just implemented the last patch, running 0.8alpha.

    Here’s my site for view: http://spencerp.net/forums/

    Only thing I’m waiting on now, is the: /bb-admin/content-categories.php page itself.. I’m getting a blog 404 when going there, but of course, didn’t see that file included, so..

    And also getting the 404, after clicking on the link:

    http://spencerp.net/forums/category/0

    But that’s to be expected right.. lol! =P

    Anyway, hopefully this might push the “project” along a little quicker LoL!. ;) :)

    spencerp

    /By the way, I left the same comment on your ticket Sam..

    #53464
    davidbessler
    Member

    This is frustrating. Tell me why this simplest of all plugins does not work.

    <?php

    /*

    Plugin Name: Add something to the header

    Plugin URI: http://davidbessler.com

    Description: My first plugin

    Author: David Bessler

    Author URI: http://davidbessler.com

    Version: 1.0

    */

    function add_something_to_the_header (){

    echo "<!--Something I added-->n";

    }

    add_action ('bb_head' , 'add_something_to_the_header');

    ?>

    #53463
    ardentfrost
    Member

    There is no instructions on how to write plugins as far as I know. You just gotta do it like the rest of us: look through the code and figure out how it’s written. It’s not too hard and it’s written logically. You need to be able to either grep or search inside the files (there’s a way to search inside php files using windows search). If you want to look for hooks, look for add_action or add_filter and see where they all are. If you want to see how to use them, look through other plugins.

    And if you have specific questions, these forums are here and there are plenty of people who try to help :)

    #52802

    In reply to: Plugin: Summon user

    AphelionZ
    Participant

    I can’t begin to express how psyched I am that you did this! I really do think its a good idea and will help a lot of forums increase their activity.

    By the way, it worked without a hitch and i have it installed over at http://outletzine.org/forums now :)

    #53478
    davidbessler
    Member

    OK look at this:

    $forum_restrict_keys = array(

    "1" => "davidbessler,testman",

    "3" => "davidbessler,",

    );

    function forum_restrict_check_name() {

    global $bb_current_user,$forum_restrict_keys;

    if ($bb_current_user){

    $allowed = strpos($forum_restrict_keys[get_forum_id()], get_user_name( $bb_current_user->ID ));

    if ($allowed == "") {

    echo "[blocked]";

    add_filter( 'get_forum_name', 'forum_restrict_blank_name');

    } else {

    echo "[Not blocked]";

    }

    }

    }

    function forum_restrict_blank_name (){

    echo "";

    }

    add_action( 'get_forum_name', 'forum_restrict_check_name');

    ?>

    That puts [blocked] instead of the forum name in a forum that user is not allowed to see, and [not blocked] on a forum he is allowed to see. How do I get the forum name back in there instead of [not blocked]?

    #52899
    spencerp
    Member

    @nateolsen, I just added ALL 3 databases into ONE database, like such:

    database_name (holding all three)

    bb_forums

    bb_posts

    bb_privatemessages

    bb_tagged

    bb_tags

    bb_topicmeta

    bb_topics

    mw_archive

    mw_categorylinks

    mw_externallinks

    mw_filearchive

    mw_hitcounter

    mw_image

    mw_imagelinks

    mw_interwiki

    mw_ipblocks

    mw_job

    mw_langlinks

    mw_logging

    mw_math

    mw_objectcache

    mw_oldimage

    mw_page

    mw_pagelinks

    mw_querycache

    mw_querycachetwo

    mw_querycache_info

    mw_recentchanges

    mw_redirect

    mw_revision

    mw_searchindex

    mw_site_stats

    mw_templatelinks

    mw_text

    mw_trackbacks

    mw_transcache

    mw_user

    mw_user_groups

    mw_user_newtalk

    mw_watchlist

    sk2_blacklist

    wp_bad_behavior

    wp_bas_log

    wp_bas_os

    wp_bas_pages

    wp_bas_refer

    wp_bas_searches

    wp_bas_ua

    wp_bas_visitors

    wp_bbpress_post_options

    wp_bbpress_post_posts

    wp_categories

    wp_comments

    wp_link2cat

    wp_linkcategories

    wp_links

    wp_options

    wp_post2cat

    wp_post2tag

    wp_postmeta

    wp_posts

    wp_secureimage

    wp_sk2_logs

    wp_sk2_spams

    wp_tags

    wp_tag_synonyms

    wp_usermeta

    wp_users

    Of course, used the normal database prefix for each one specifically. ;) :) It was mentioned though, that for the mw_ ones, you didn’t have to use the “mw_” prefix for when trying to mesh with bbpress/WP.. but, to play it safe, I used the default “mw_” prefix anyway.. Choice is your’s really.. :) ;)

    @mozey, nice!! I’ll have to try that out sometime, well, when I get more time. ;) :) Thanks for tips and pointers! ;) :)

    spencerp

    #1257
    davidbessler
    Member

    I’m REALLY new at making plugins. Let’s start there.

    I’m looking to hide certain forums from a defined list of people. Or actually, I’m looking to only allow certain people to see certain forums. Anyway, I’m starting with just trying to make that happen on the front page. How do I “hijack” the page just at the point where it is about to spit out the forums on the front-page? I think this is what hooks are for right? So that I don’t need to actually edit my front-page.php?

    Basically what I am looking to do, is during the “foreach” loop in front-page.php, I want to compare the upcoming forum_id with a list of usernames in an array who are allowed to see that forum. If there’s a match, it shows the forum, if not, it doesn’t.

    The array looks like this:

    $forum_restriction_keys = array(

    "1" => "bob, sam, jim, jane",

    "3" = > "bob",

    );

    So, to start, I need the right hook.

Viewing 25 results - 31,376 through 31,400 (of 32,462 total)
Skip to toolbar