551

(35 replies, posted in PunBB 1.3 extensions)

Maybe someone will find what from the 1. extension we have to add to 2. extension to make the URL catching within mp3 tags go away...

1. VideoTag manifest.xml
[code=xml]
    <hooks>
        <hook id="he_new_bbcode_link"><![CDATA[

// add our lang file
if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'.php')) {
    require($ext_info['path'].'/lang/'.$forum_user['language'].'.php');
} else {
    require($ext_info['path'].'/lang/English.php');
}
$lang_help = array_merge($lang_help, $lang_help_video);
?>
<div class="entry-content">
    <code>[video]<?php echo $lang_help['video_uri'] ?>[/video]</code><span><?php echo $lang_help['produces'] ?></span>
    <?php echo $lang_help['video_display'] ?>
</div><?php

        ]]></hook>
        <hook id="ps_start"><![CDATA[

// tag handling function
function handle_video_tag($videoUri) {
    global $forum_config;
    $match = array();

    // dirty trick to play arround do_clickable
    preg_match('`href="([^"]+)"`', stripslashes($videoUri), $match);
    if(!empty($match[1])) {
        $videoUri = $match[1];
    }

    // the services list
    $service = array(
        'youtube' => array(
            'match'=>'`watch\?v=([-_a-z0-9]+)`i',
            'uri'=>'http://www.youtube.com/v/%s&amp;rel=0',
            'width'=>425,
            'height'=>344
        ),
        'dailymotion' => array(
            'match'=>'`video/([a-z0-9]+)_`i',
            'uri'=>'http://www.dailymotion.com/swf/%s&amp;amp;related=0&amp;amp;canvas=medium',
            'width'=>480,
            'height'=>381
        ),
        'vimeo' => array(
            'match'=>'`/([0-9]+)`',
            'uri'=>'http://www.vimeo.com/moogaloop.swf?clip_id=%s&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;fullscreen=1',
            'width'=>400,
            'height'=>302
        ),
        'google' => array(
            'match'=>'`\?docid=(-?[0-9]+)`',
            'uri'=>'http://video.google.com/googleplayer.swf?docId=%s',
            'width'=>425,
            'height'=>364
        )
    );

    // extract service's name and check for support
    preg_match('`^http://(?:[^\.]*\.)?([^\.]*)\.[^/]*/`i', $videoUri, $match);
    if(empty($match[1]) || !array_key_exists($match[1], $service)) {
        return '<a href="'.$videoUri.'">[video (unkown provider)]</a>';
    }
    $s = $service[$match[1]];

    // extract videoId
    preg_match($s['match'], $videoUri, $match);
    if(empty($match[1])) {
        return '<a href="'.$videoUri.'">[video (cant extract ID)]</a>';
    }
    $playerUri = sprintf($s['uri'], $match[1]);

    // display flash player
    return
        '<object type="application/x-shockwave-flash" data="'.$playerUri.'" width="'.$s['width'].'" height="'.$s['height'].'">'.
            '<param name="movie" value="'.$playerUri.'" />'.
            '<param name="wmode" value="transparent" />'.
            '<param name="allowfullscreen" value="true" />'.
            '<p><a href="'.$videoUri.'">[video (flash player not installed)]</a></p>'.
        '</object>';
}

        ]]></hook>
        <hook id="ps_preparse_tags_start"><![CDATA[

// add our tag to the list
$tags[] = 'video';
$tags_opened[] = 'video';
$tags_closed[] = 'video';
$tags_inline[] = 'video';
$tags_trim[] = 'video';
// we must allow url due to do_clickable
$tags_limit_bbcode['video'] = array('url');

        ]]></hook>

        <hook id="ps_do_bbcode_replace"><![CDATA[

// add pattern to catch [video]blahblah[/video]
$pattern[] = '`\[video\]([^\[]+)\[/video\]`e';
$replace[] = 'handle_video_tag(\'$1\')';

        ]]></hook>
    </hooks>
[/code]


2. MP3 Player manifest.xml

[code=xml]
<hooks>
        <hook id="ps_parse_message_post_merge"><![CDATA[

            // Mod: Flash MP3 Player (8 new lines follow)

            $player_url     = $ext_info['path'].'/dewplayer-multi.swf';

            $player_bgcolor = 'ffffff';

            $player_width   = 240;

            $player_height  = 20;

            $player_param   = '?bgcolor='.$player_bgcolor.'&amp;mp3=$2';  // For more options: http://www.alsacreations.fr/?dewplayer

            $player_alternative = '<strong>Flash not detected</strong>';

            $player_code = "\n\t\t\t\t\t<object type=\"application/x-shockwave-flash\" data=\"".$player_url.$player_param."\" width=\"".$player_width."\" height=\"".$player_height."\">\n\t\t\t\t\t  <param name=\"movie\" value=\"".$player_url.$player_param."\" />\n\t\t\t\t\t  <param name=\"bgcolor\" value=\"#".$player_bgcolor."\" />\n\t\t\t\t\t  ".$player_alternative."\n\t\t\t\t\t</object>\n\t\t\t\t\t";

            $text = preg_replace("#\[mp3\](&quot;|\"|'|)(.*?)\\1\[/mp3\]#", $player_code, $text);

            $text = preg_replace("/\[mp3 url=(&quot;|\"|'|)(.*?)\\1\]/", $player_code, $text);

        ]]></hook>

       

        <hook id="po_qr_get_quote"><![CDATA[

            // Mod: Flash MP3 Player (1 new line follow)

            $q_message = preg_replace("/\[mp3 url=(&quot;|\"|'|)(.*?)\\1\]/", "$2", $q_message);

        ]]></hook>

    </hooks>
[/code]

He could just log out and vote as guest then (if that's enabled). Is 1 vote really going to matter?

553

(3 replies, posted in PunBB 1.3 troubleshooting)

isn't there a /lang/english.php file in the extension ?
that would be where you change that...

EDIT: just saw you're asking about inserting "myname" - so username - which seems pointless as it's in the section about the author in the first place...

554

(13 replies, posted in PunBB 1.3 troubleshooting)

Why don't you put all your buttons in <div> via main.tpl above your navlinks (navigation menu ... index... etc)
If you start playing around with taking out links that you'll need from every other part of the board to get back to index, you'll end up with chaos big_smile

DiD wrote:

I'm a extension developer now?

You developed an extension = extension developer wink

Thx for update

noodles wrote:

It would be nice, if you could change your vote

Added to wishlist big_smile

rs324 wrote:

the important idea is the basic function will work for the first version

Yes it's a nice first release big_smile

rajuru wrote:

i think this is an extension that may need community attention!

Yes and/or a PunBB developer to tell us how best to make it compatible....

rajuru wrote:

Can you kindly make RTL and LTR configurable?

He can also very simply just change that line (43) / or someone else can - and release the identical extension - it's not necessary to add that to admin settings necessarily...

558

(4 replies, posted in PunBB 1.3 troubleshooting)

You don't mean option in
» Administration » Settings » Setup
Add your own links to the main navigation menu
?

If you just want to add links in .tpl you need to use html <a href .... etc></a> I believe...
also add style properties if you're wrapping it in a <div> via .css

Unless you're trying to achieve something else I can't imagine smile

KANekT wrote an extension for adding a topic description - so that's very similiar to what you want.

Here's how his extension manifest looked. Best to probably ask him to code it for you? Maybe offer him a small token of appreciation big_smile

[code=xml]
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* manifest file for topic description
*
* @copyright Copyright (C) KANekT @ http://blog.kanekt.ru
* @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
* Donate Web Money Z104136428007 R346491122688
* @package topic description
*/
-->
<extension engine="1.0">
    <id>topic_desc</id>
    <title>topic description</title>
    <version>0.5.0</version>
    <description>Topic Description</description>
    <author>KANekT</author>
    <minversion>1.3.4</minversion>
    <maxtestedon>1.3.4</maxtestedon>
    <install>
        <![CDATA[
                $forum_db->add_field('topics', 'topic_desc', 'varchar(255)', true);
                $query = array(
                   'INSERT'  => 'conf_name, conf_value',
                   'INTO'    => 'config',
                   'VALUES'  => '\'o_topic_desc\', \'0\''
                );
                $forum_db->query_build($query);
        ]]>
    </install>
    <uninstall>
        <![CDATA[
            $forum_db->drop_field('topics', 'topic_desc');
            $query = array(
                'DELETE'     => 'config',
                'WHERE'        => 'conf_name in (\'o_topic_desc\')',
            );
            $forum_db->query_build($query);
        ]]>
    </uninstall>
    <hooks>
        <hook id="po_pre_post_contents" priority = "2">
            <![CDATA[
            if ($fid)
            {
                if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'.php'))
                    require $ext_info['path'].'/lang/'.$forum_user['language'].'.php';
                else
                    require $ext_info['path'].'/lang/English.php';
                ?>
                <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
                    <div class="sf-box text required longtext">
                        <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_topic['Topic Description']; ?></span></label><br />
                            <span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="topic_desc" value="<?php echo empty($_POST['topic_desc']) ? '' : forum_htmlencode($_POST['topic_desc']) ?>" size="80" maxlength="100"/></span>
                    </div>
                </div>
            <?php
            }
            ]]>
        </hook>
        <hook id="po_end_validation, mr_confirm_split_posts_form_submitted"><![CDATA[
            if (!empty($_POST['topic_desc']))
                $new_desc = utf8_trim($_POST['topic_desc']);
        ]]></hook>
        <hook id="po_pre_add_topic"><![CDATA[
        if(isset($new_desc)) $post_info['topic_desc'] = $new_desc;
        ]]></hook>       
        <hook id="fn_add_topic_qr_add_topic"><![CDATA[
            if (!empty($post_info['topic_desc']))
            {
                $query['INSERT'] .= ', topic_desc';
                $query['VALUES'] .= ', \''.$forum_db->escape($post_info['topic_desc']).'\'';
            }
        ]]></hook>       
        <hook id="ed_pre_message_box" priority = "2"><![CDATA[
                if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'.php'))
                    require $ext_info['path'].'/lang/'.$forum_user['language'].'.php';
                else
                    require $ext_info['path'].'/lang/English.php';
                   
            if ($can_edit_subject && (FORUM_PAGE != 'ajax_post_edit')):
            $top = forum_htmlencode(isset($_POST['topic_desc']) ? $_POST['topic_desc'] : $cur_post['topic_desc']);           
            ?>
                <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
                    <div class="sf-box text required longtext">
                        <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_topic['Topic Description']; ?></span></label><br />
                            <span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="topic_desc" value="<?php echo $top ?>" size="80" maxlength="100"/></span>
                    </div>
                </div>
            <?php
            endif;
        ]]></hook>
        <hook id="ed_qr_update_subject"><![CDATA[
            $topic_desc = forum_trim($_POST['topic_desc']);
            $query['SET'] .= ', topic_desc=\''.$forum_db->escape($topic_desc).'\'';
        ]]></hook>
        <hook id="vf_qr_get_topics, ed_qr_get_post_info"><![CDATA[
                $query['SELECT'] .= ', t.topic_desc';
        ]]></hook>
        <hook id="vf_row_pre_item_subject_merge"><![CDATA[
        if (!empty($cur_topic['topic_desc']))
        {
            if ($forum_config['o_topic_desc'] != '0')
            {
                $forum_page['item_body']['subject']['topic_desc'] = '<p><small>'.forum_htmlencode($cur_topic['topic_desc']).'</small></p>';
            }
        }
        ]]></hook>
        <hook id="vf_topic_loop_normal_topic_pre_item_title_merge"><![CDATA[
        if (!empty($cur_topic['topic_desc']))
        {
            if ($forum_config['o_topic_desc'] != '1' )
            {
                $forum_page['item_title']['link'] = '<a href="'.forum_link($forum_url['topic'], array($cur_topic['id'], sef_friendly($cur_topic['subject']))).'" alt="'.$cur_topic['topic_desc'].'" title="'.$cur_topic['topic_desc'].'">'.forum_htmlencode($cur_topic['subject']).'</a>';

            }
        }
        ]]></hook>
        <hook id="ape_start"><![CDATA[
            define('FORUM_PAGE', 'ajax_post_edit');
        ]]></hook>
        <hook id="aop_features_validation"><![CDATA[
if (!isset($form['topic_desc'])) $form['topic_desc'] = '0';
        ]]></hook>
       
        <hook id="aop_features_message_fieldset_end"><![CDATA[
    if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'.php'))
        require $ext_info['path'].'/lang/'.$forum_user['language'].'.php';
    else
        require $ext_info['path'].'/lang/English.php';

        // Reset counter
    $forum_page['group_count'] = $forum_page['item_count'] = 0;
?>
            <div class="content-head">
                <h2 class="hn"><span><?php echo $lang_topic['Topic features head'] ?></span></h2>
            </div>
            <fieldset class="frm-group group<?php echo ++$forum_page['group_count'] ?>">
                <legend class="group-legend"><span><?php echo $lang_topic['Topic legend'] ?></span></legend>
                <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
                        <div class="mf-box">
                            <div class="mf-item">
                                <span class="fld-input"><input type="radio" id="fld<?php echo ++$forum_page['fld_count'] ?>" name="form[topic_desc]" value="0"<?php if ($forum_config['o_topic_desc'] == '0') echo ' checked="checked"' ?> /></span>
                                <label for="fld<?php echo $forum_page['fld_count'] ?>"><?php echo $lang_topic['Topic enable'] ?></label>
                            </div>
                            <div class="mf-item">
                                <span class="fld-input"><input type="radio" id="fld<?php echo ++$forum_page['fld_count'] ?>" name="form[topic_desc]" value="1"<?php if ($forum_config['o_topic_desc'] == '1') echo ' checked="checked"' ?> /></span>
                                <label for="fld<?php echo $forum_page['fld_count'] ?>"><?php echo $lang_topic['Topic enable mouse'] ?></label>
                            </div>
                            <div class="mf-item">
                                <span class="fld-input"><input type="radio" id="fld<?php echo ++$forum_page['fld_count'] ?>" name="form[topic_desc]" value="2"<?php if ($forum_config['o_topic_desc'] == '2') echo ' checked="checked"' ?> /></span>
                                <label for="fld<?php echo $forum_page['fld_count'] ?>"><?php echo $lang_topic['Topic enable and mouse'] ?></label>
                            </div>
                        </div>
                </div>
            </fieldset>
<?php       
               
        ]]></hook>    </hooks>
</extension>

[/code]

Thanks for those infos smile
============================
Just noticed I run into trouble as soon as I use a lot of the other options
http://keydogbb.info/img/tiny2.png

If I insert emotions into manifest and then use the smilies I get code in post instead of actual smilies, like this:

[img]extensions/punbb_wysiwyg/tiny_mce/plugins/emotions/img/smiley-innocent.gif[/img]

If I use background color I get

<span style="background-color: #ffcc00;">This is a test</span>

When I try lists with bullets I just get

<ul><li>

etc....  and for numbered list I get

<ol><li>

etc


Guess one would have to add support to all those others via parser.php....?

561

(2 replies, posted in Feature requests)

http://punbb.informer.com/forums/topic/ … b-twitter/

Does that do anything you want? If not, I've never seen anything else here that goes in that direction.
In any case, he (rajuru) would be the best person here to adress on the subject - he's short on time though...

Gujjerji110 wrote:

can you do like vb
mean in star

Added that to the wanted features just now.

This really is working quite well. Today 4 users got auto-nuked for wanting to use bad URLs big_smile

http://keydogbb.info/img/urlcheck.png

A while back I had this ajax post rating extension developed (by Salov Radoslav).
http://keydogbb.info/img/rating.png

Download Version 0.0.1

Mirror 1 | Mirror 2


Current Features:

  • Allows setting to allow guests to rate

  • Allows setting to allow unlimited number of rating

  • Allows setting to allow only members to rate

  • Adds the IPs of voters to the db


Now I'm looking for someone to add some features to it

Wanted Features:

  • Optional way of showing which members have given positive or negative rating (either by hovering on the + sign, or by clicking somewhere

  • Optional way of showing how many of the votes were from guests and how many from members

  • Add: Stars rating of topics

  • Member should be able to undo a rating


Note

  • I'd appreciate that in return for having paid for the initial development of it and makin it available to everyone.

  • If you can't code but would like to support the further development (with some change so I can pay someone to do it...) please contact me.

  • @PunBB Developers: You're welcome to make this an official extension and change whatever is necessary to enhance it

(PS: It was developed with the understanding that it would be published to this community.)

565

(32 replies, posted in PunBB 1.3 extensions)

New or updated in July/August

http://keydogbb.info/img/3008-extension.png

@Gujjerji110: Here's what the demo looks like by default...

http://keydogbb.info/img/tiny.png

@rs324: Nice extension!
Q: Those options above appearing on the right can be controlled by the css right? Also the code, color, list - how would you add those?

567

(5 replies, posted in Discussions)

rs324 wrote:

will you use it at downloads center ?

Yes, see no reason why it shouldn't be added there. That other post proves everyone doing RTL has that issue.

rs324 wrote:

i will send you a link when im done 

Cool.

Thanks.

568

(5 replies, posted in Discussions)

rs324 wrote:

i have checked this post out , but he didn't realsed anything related to rtl

Yeah, I need to follow that up, will shoot  him an email -
or do you plan to release your table version?

PS: added the language link to prior post

569

(5 replies, posted in Discussions)

Glad to hear it.

RE: language
Upload is possible and appreciated here:
http://punbb.informer.com/wiki/lib/exe/ … nbb13/lang

PS: check with guy who wrote this post about RTL
http://punbb.informer.com/forums/post/124869/#p124869

Color code you want to change to white is #CCC

571

(1 replies, posted in PunBB 1.3 troubleshooting)

I did it via
oxygen.css

search for
*********
#brd-navlinks li a {


add
*********

    font-weight: bold;

572

(6 replies, posted in PunBB 1.3 troubleshooting)

http://punbb.informer.com/forums/forum/ … eshooting/

is always a good place.

1. Download firebug add-on for firefox
2. Search the oxygen_cs.css for #00579C (I believe that's the color you want changed)

In Google Chrome or Chromium (ubuntu big_smile) - when you mark the link and right click and 'inspect element' you'll get info on the 'class' etc - if you go to oxygen.css or in most cases oxygen_cs.css you'll find a way to change the color. (Similar tools are available for firefox etc)

PS: Changed your signature to one line instead of two.... easier on the eyes

Just wondering if it wouldn't make a lot of sense to submit all the users deleted to the stopforumspam.com db.

This is some info they have on their site on how to do it (please also see Grez's comment on doing it an easier way)
[code=php]
function PostToHost($data) {
$fp = fsockopen("www.stopformspam.com",80);
fputs($fp, "POST /add.php HTTP/1.1\n" );
fputs($fp, "Host: www.stopforumspam.com\n" );
fputs($fp, "Content-type: application/x-www-form-urlencoded\n" );
fputs($fp, "Content-length: ".strlen($data)."\n" );
fputs($fp, "Connection: close\n\n" );
fputs($fp, $data);
fclose($fp);
}
PostToHost("username=USERNAME&ip_addr=IPADDRESS&email=
    EMAILADDRESS&api_key=XXXXXXXXXXXXX");
[/code]

IMO, a prompt for the API key following Slavoks' script and a "Do you want to submit the deleted users to stopforumspam.com?" prompt would make a lot of sense.