Skip to:
Content
Pages
Categories
Search
Top
Bottom

Missing Argument for Get_User_Profile_Link


  • papadoc
    Member

    @papadoc

    Hi, all…

    I’ve looked around and haven’t been able to find a solution to my problem…

    My forum, elephantwords.co.uk/forum, has a “last poster” bit at the bottom of each page, that, on thread and forum pages, shows the last poster to have posted… I’ve used the Get_User_Profile_Link to make the name of the poster link to the last poster’s profile.

    The thing is, it doesn’t work. Go to the site to see what I mean, but when you mouseover the link, a message across the bottom of the browser says “Missing Argument 1 for Get_User_Profile_Link”

    I don’t know any php, and I’ll admit to having nabbed most of the code from other templates. However, I’m convinced that this worked when I first put it in, and I’ve no idea how to fix it now. The Latest Discussions bit, which is next to it in the bottom page navigation, works fine.

    Does anyone have a clue what’s up here? My flabber is totally gasted…

Viewing 8 replies - 1 through 8 (of 8 total)

  • _ck_
    Participant

    @_ck_

    Offhand I’d guess that the last poster function is meant to be “in the loop” for a per topic basis. Because you are trying to use it for an entire sub-forum, it’s missing a topic id reference. You’d have to calculate the last topic that the last poster posted in.

    Posting the code to that part of the template would help (at least for me)

    Are you using .8.2.1?

    get_user_profile_link() doesn’t actually have any required arguments in the newest version (http://trac.bbpress.org/browser/tags/0.8.2.1/bb-includes/template-functions.php, line 1070). I can’t understand why you’d have a problem like that.

    I don’t think it needs to be used in the loop. It does if you’re not going to provide arguments, but this is an error generated by PHP not bb. Any variables passed to it that would have been set in the loop but aren’t set outside it would simply be passed along, without an error, albeit unset.


    papadoc
    Member

    @papadoc

    Well, it turns out I’m NOT using .8.2.1, just .8.1… Is the newest version REALLY new?

    The code I’ve used in the template is, I think, outside the loop, and is this:

    <H2><?php _e('Last Poster'); ?></H2>
    <UL><LI><a href="<?php get_user_profile_link() ?>">
    <?php topic_last_poster(); ?></a></LI></UL>

    I may not have made my problem all that clear, anyway… the fact is that the Last Poster bit works fine… it pulls up the last poster’s name fine. But when you mouseover the link, it becomes clear that it doesn’t work, presenting the problem I mentioned before…

    YES! The newest version is ALWAYS really new. REALLY new. There is NEVER a situation where you shouldn’t upgrade.

    You have a problem and you’re not running the latest version. What do you do? Go upgrade.

    You don’t have a problem. You’re not running the latest version. What do you do? GO UPGRADE.

    Upgrading might not even fix this problem, it’s not sure. But it does fix several security exploits and adds a bunch of featurs. Go upgrade!

    What’s worst is that you’re on a support forum asking for help and you’re not even on the latest version. You clearly haven’t tried everything before making other people take time to help you. Then you’re advised to upgrade … GO UPGRADE already.

    If I wasn’t clear … GO UPGRADE


    papadoc
    Member

    @papadoc

    Sheesh, okay, I did that already. Before you even posted.

    It didn’t fix my problem but on the other hand, it DID make the dashboard nicer.

    Oh, and broke at least one of the key plugins on the site :-(

    But yeah, ultimately, I will always upgrade, when I realise there IS an upgrade.

    Want to know something interesting? Now, instead of a link to a broken page, the displayed names of the most recent poster ALL link back to my forum address, apparently regardless of the user… Any suggestions?

    I can’t remember which version added what, but make sure to activate your plugins in bb-Admin/Site Management or they won’t work.

    Try this:

    <?php $user = bb_get_user( topic_last_poster() );
    get_user_profile_link( $user->ID ); ?>

    You can make it one line if you want but you need those semicolons.


    papadoc
    Member

    @papadoc

    Fel,

    I’ve managed to get the plugins mostly working, although not entirely well… but I’m asking for help on those in their relevant forums.

    As far as that code goes, it still works fine as far as displaying the last poster, but the profile link still isn’t working… Although I think we’re moving in the right direction, as now instead of linking to a fault page, or the forum index, it’s just not showing a link at all.


    papadoc
    Member

    @papadoc

    Anyone got any ideas?

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.