Skip to content

Commit a2f65e7

Browse files
author
3Di
committed
version 1.0.0-b3
1 parent 667e9dc commit a2f65e7

6 files changed

Lines changed: 23 additions & 27 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ The primenote MOD as an extension for phpBB3.1
33

44
Build Status: [![Build Status](https://travis-ci.org/3D-I/notebbcode.svg)](https://travis-ci.org/3D-I/notebbcode)
55

6-
Adds a Note BBCode, which displays a tooltip-like box containing text when the mouse is moved over the Note BBCode icon. The text inside the box can accept BBCodes, and the pop-up box will close automatically when the mouse is moved off the icon (unless the user clicks the icon, which will make the pop-up box stick in place until manually closed or until the cursor is moved a certain distance away from the pop-up box). Parses also smilies.BBcodes are automatically installed by the extension, no need to any manual input.
6+
Adds a Note BBCode, which displays a tooltip-like box containing text when the mouse is moved over the Note BBCode icon. The text inside the box can accept BBCodes, and the pop-up box will close automatically when the mouse is moved off the icon (unless the user clicks the icon, which will make the pop-up box stick in place until manually closed or until the cursor is moved a certain distance away from the pop-up box). Parses also smilies.BBcodes are automatically installed by the extension, no need to any manual input, just set to display on posting in ACP if you like.
77

88
## Usage
99

1010
![Screenshot](Screenshot_1.png)
1111

12+
![Screenshot](Screenshot_2.png)
13+

Screenshot_1.png

725 Bytes
Loading

Screenshot_2.png

8.24 KB
Loading

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "threedi/notebbcode",
33
"type": "phpbb-extension",
4-
"description": " Add a Note BBCode, which displays a tooltip-like box containing text when the mouse is moved over the Note BBCode icon. The text inside the box can accept BBCodes, and the pop-up box will close automatically when the mouse is moved off the icon (unless the user clicks the icon, which will make the pop-up box stick in place until manually closed or until the cursor is moved a certain distance away from the pop-up box). Parses also smilies. BBcodes are automatically installed by the extension, no need to any manual input.",
4+
"description": " Add a Note BBCode, which displays a tooltip-like box containing text when the mouse is moved over the Note BBCode icon. The text inside the box can accept BBCodes, and the pop-up box will close automatically when the mouse is moved off the icon (unless the user clicks the icon, which will make the pop-up box stick in place until manually closed or until the cursor is moved a certain distance away from the pop-up box). Parses also smilies. BBcodes are automatically installed by the extension, no need to any manual input, just set to display on posting in ACP if you like.",
55
"homepage": "http://3d-i.github.io/notebbcode/",
6-
"version": "1.0.0-b2",
6+
"version": "1.0.0-b3",
77
"license": "GPL-2.0",
88
"authors":
99
[
@@ -33,7 +33,7 @@
3333
"Prime note bbcode",
3434
"soft-require":
3535
{
36-
"phpbb/phpbb": ">=3.1.7-pl1,<3.2.*@dev"
36+
"phpbb/phpbb": ">=3.1.7-pl1,<3.2.0@dev"
3737
}
3838
}
3939
}

ext.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
class ext extends \phpbb\extension\base
1717
{
18+
const VERSION_NOTEBBCODE = '1.0.0-b3';
19+
1820
/**
1921
* Check whether or not the extension can be enabled.
2022
* The current phpBB version should meet or exceed

migrations/notebbcode_1.php

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<?php
22
/**
33
*
4-
* notebbcode (Prime Note Bbcode) - extension
5-
*
6-
* @copyright (c) 2016 3Di
7-
*
8-
* (based on the hard work of Matt Friedman/VSE)
9-
*
10-
* @license GNU General Public License, version 2 (GPL-2.0)
4+
* @package phpBB Extension - notebbcode
5+
* @copyright (c) 2016 3Di (Marco T.)
6+
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
117
*
8+
* (migration based on the hard work of Matt Friedman/VSE)
129
*/
1310

1411
namespace threedi\notebbcode\migrations;
@@ -30,34 +27,29 @@ public function update_data()
3027
public function revert_data()
3128
{
3229
return array(
33-
array('custom', array(array(&$this, 'remove_notebbcodes'))),
30+
array('custom', array(array(&$this, 'notebbcodes_behind'))),
3431
);
3532
}
3633

3734
/**
38-
* Remove BBCodes, used by migrations to perform removes
35+
* notebbcodes left behind, hides the bbcode buttons on posting
3936
*
40-
* @param array $bbcode_tags Array of BBCode tags to remove
37+
* @param array $bbcode_tags Array of noteBBCodes tags to hide
4138
* @return null
4239
* @access public
4340
*/
44-
public function remove_notebbcodes($bbcode_tags)
41+
public function notebbcodes_behind($bbcode_tags)
4542
{
46-
global $cache;
47-
4843
/**
49-
* @var array An array of bbcodes tags to remove
44+
* @var array An array of notebbcodes (tags) to be left behind
5045
*/
5146
$bbcode_tags = array('note', 'note=');
5247

53-
// remove existing bbcodes
54-
$sql = 'DELETE FROM ' . BBCODES_TABLE . '
55-
WHERE ' . $this->db->sql_in_set('bbcode_tag', $bbcode_tags) . '
56-
OR bbcode_id < 0';
57-
$this->db->sql_query($sql);
58-
59-
// purge the bbcodes' cache
60-
$cache->destroy('sql', BBCODES_TABLE);
48+
// set to null the display on posting
49+
$sql = 'UPDATE ' . BBCODES_TABLE . '
50+
SET display_on_posting = 0
51+
WHERE ' . $this->db->sql_in_set('bbcode_tag', $bbcode_tags);
52+
$this->db->sql_query($sql);
6153
}
6254

6355
/**
@@ -85,7 +77,7 @@ public function install_notebbcodes($bbcode_data)
8577
'bbcode_match' => '[note]{TEXT}[/note]',
8678
'bbcode_tpl' => '<span class="prime_bbcode_note_spur" onmouseover="show_note(this);" onmouseout="hide_note(this);" onclick="lock_note(this);"></span><span class="prime_bbcode_note">{TEXT}</span>',
8779
'bbcode_helpline' => '[note]note text[/note]',
88-
'display_on_posting'=> 1,
80+
'display_on_posting'=> 0,
8981
),
9082
'note=' => array(
9183
'bbcode_match' => '[note={TEXT1}]{TEXT2}[/note]',

0 commit comments

Comments
 (0)