Fork me on GitHub

Auto-Topics when the news are publicated  Bottom

Go to page 1 - 2 [+1]:

  • Hello,

    I'm makeing a hack for to post topics in PNphpBB2 when you publicate a news in postnuke .761. I finnished my project, but I've got a problem, and it do not work.

    In AddStory>adstory_functions.php I putted a code for to show a menu to choose the forum where the topic will be created, but it do not show it. The code is:


    Code

    function buildForumMenu($fsel)
    {
        if(!pnModAvailable("PNphpBB2")) {
            return;
        }
        if(!pnModAPILoad('PNphpBB2', 'admin')) {
            return;
        }

        $out = "";
        $forums = pnModAPIFunc('PNphpBB2', 'admin', 'readforums');

        if(count($forums)>0) { 
            include_once('modules/PNphpBB2/common.php');
            $out = '<br /><br /><strong>'._DPHACK_SELECT_FORUM.'<strong /><br />';
            $out .= '<select name="phpbb_forum" id="phpbb_forum" size="1">';
            $selected = ((int)$fsel=="0") ? "selected" : "";

            $out.='<option value="0" '.$selected.'>'. _DPHACK_ALLFORUMS .'</option>';
            foreach($forums as $forum) {
                if(allowedtoreadcategoryandforum($forum['cat_id'], $forum['forum_id'])) {
                    $selected = ((int)$fsel==(int)$forum['forum_id']) ? "selected" : "";
                    $out .= '<option value="'.$forum['forum_id'].'" '.$selected.'>'.pnVarPrepForDisplay($forum['cat_title']).' > '.pnVarPrepForDisplay($forum['forum_name']).'</option>';
                }
            }
            $out .= '</select><br /><br /><br />';
        }
        echo $out;
    }


    Somebody know where is the error? Thanks you
  • I assume you are actually calling that function somewhere?

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • This looks like pnForum syntax you are using there.

    Frank

    --
    "He is not dangerous, he just wants to play...."
  • Ummm the function is

    Code

    function buildForumMenu($fsel)
    , in adstory_functions.php archive

    It is? Tell me if yo need the entire archive or something
  • Landseer, yes, its based on a part of xintax of pnForum, developed in dev-postnuke[dot].com
  • pnForum syntax won't work in pnphpbb.

    e.g. allowedtoreadcategoryandforum() is a very special function in pnForum which checks a users permission. Pnphpbb does not even use the PN permission system.

    For pnForum this functionality (adding news -> new posting in forum) is already implemented in the version 2.6 you can get from the CVS so for this forum there is no need to reinvent the wheel.

    --
    "He is not dangerous, he just wants to play...."
  • Hi. Thanks you, but i want to add this function to work with PNphpBB, and this part of the code is the last to modify, and i don't know how to do it... and in dev-postnuke don't like to make it... Can you help me?
  • Sorry no, I don't have a clue about pnphpbb icon_smile but I know that the code you posted will not work.

    Frank

    --
    "He is not dangerous, he just wants to play...."
  • OK... xD I attained to implement this function in pnForum 2.0.1 for to postnuke 0761 (the version made by "el_cuervo" is for to 0750), and it works correctly, but the colors in the forum are some... complicated to adapt to them xD.

    Eh, the last RC of pnForums are 2.5? Because you mencioned 2.6

    Thanks ;)
  • The RC is 2.5, in the meantime I raised the version to 2.6. You can get this from the CVS or as daily snapshot from here.

    Frank

    --
    "He is not dangerous, he just wants to play...."
  • Ajam, but... this func. need a modification in the news module, and the forum not include this mod, or yes? (sorry, i'm spanish :S)
  • No, this function does not need a modification of the News module. It adds some hooks to the system and the News calls the appropriate hooks when a submission gets approved.

    Frank

    --
    "He is not dangerous, he just wants to play...."
  • Ummm but if you do not make any modification in News Module... if you write a message as comment in the news, this message will not posted in the forum, and vice versa, no? Thanks for all your answers ;)
  • No, that doesn't work. The createhook is designed to create new topics, not to create replies to existing ones.

    --
    "He is not dangerous, he just wants to play...."
  • One more question only... If you are the creator (or developer) of pnForum... could you add this feature to the future version? (When I create the news, a post will be created too, and if you read 4 times the forum, in the news you will be able to see the same reads, etc.) It would be very interesant for to implement, no? News module needs to be modificated, but I think that it isn't a problem, no?

    Ah, when do you divulge the 2.5 (or 2.6) NO-RC forum? Thanks ;)

Go to page 1 - 2 [+1]:

This list is based on users active over the last 60 minutes.