wildcardsearch / yourcode Goto Github PK
View Code? Open in Web Editor NEWForget MyCode. Take control of YourCode-- a much better way of handling BB Code for MyBB forums
License: GNU General Public License v3.0
Forget MyCode. Take control of YourCode-- a much better way of handling BB Code for MyBB forums
License: GNU General Public License v3.0
Installer 2.0 adds PostgreSQL support.
I came here from this thread
https://community.mybb.com/thread-134038-post-1246127.html#pid1246127
Im trying to restrict post icons to certain user groups. I have no idea how to use this mod, or to modify it. When i enabled it, some of the original BBcode broke and just shows BBcode within the post now.
IS there a how to use this plugin?
I just installed YourCode and editing things with these characters in them worked fine before. Screenshot provided by one of my members.
[15:40:24] <%Keileon> I noticed in both instances there's an apostrophe screwing it up and said apostrophe is inside the color code
[15:40:55] <%Keileon> YEP it's that
[15:41:19] <%Keileon> I just randomly inserted "[color=blue]'[/color] into one of my posts
[15:41:25] <%Keileon> I got the error
[15:42:11] <%Keileon> Try momentarily disabling the plugin
...to eliminate issues where servers with improper permissions for upload folder preventing installation of images.
SQL Error:
1366 - Incorrect integer value: 'NULL' for column 'sid' at row 1
Query:
INSERT INTO mybb_settings (`sid`,`name`,`title`,`description`,`optionscode`,`value`,`disporder`,`gid`) VALUES ('NULL','yourcode_minimize_js','Minimize JavaScript?','YES (default) to serve client-side scripts minified to increase performance, NO to serve beautiful, commented code ;)','yesno','1','10',45)
This is the current error i am getting on a fresh install. any way to bypass it or solve it @WildcardSearch ?
When a YourCode's callback
option is true
, and the user view permissions are set, and the alternate replacement is used, postParser
sent information leading it to attempt to use the replacement text as the method of the callback, eg. postParser::alt_replacement
.
If a callback
YourCode cannot be viewed by the user and has an alternate replacement, that YourCode should be moved to the nestable
category and the nestable
count incremented.
EDIT: The alternate replacement is irrelevant.
...in acp.php and a standard alert()
should be replaced with jGrowl in yourcode_inline.js
...which has been deprecated in PHP 7.
Need to get the JavaScript converted and I think everything else should work as-is.
An incorrectly spelled method name in functions_acp.php causes the backup tool to fail.
Reported here: https://community.mybb.com/thread-208382-post-1268458.html#pid1268458
...huge oversight on my part. A change in the parser class results in modules working fine, but no processing in parse_message_x
.
oops
When using the inline edit to select one or more YourCode to modify, when using the Deactivate
option the resulting flash message informs the user that they have activated rather than deactivated x
YourCodes.
When inactive, the donate, logo, and link icons are not showing and, upon further review, shouldn't even be shown until the plugin is installed and activated.
Although all of the JavaScript is in ACP, I'd still like to reduce it as much as is possible.
19:39:24.510 TypeError: this.prop is not a function
keepCount()yourcode_inline.js:109
m.event.dispatch()jquery.js:4
m.event.add/r.handle()jquery.js:4
1yourcode_inline.js:109:6
Hello!
After deactivating YourCode and uploading the new files, I see the following message on the plugins tab (and the plugin list does not load):
Fatal error: 'continue' operator with non-constant operand is no longer supported in /usr/www/kretol/public/conquestofthehorde.com/inc/plugins/yourcode/acp.php on line 663
Block in question:
elseif(in_array($mybb->input['inline_action'], array('deactivate', 'delete')))
{
if(!in_array($name, $active_modules))
{
continue $c_level; //<-- here is line 663
}
// deactivate
$yourcode['active']['modules'] = $active_modules = array_filter(
$active_modules,
function($var) use($name)
{
return $var != $name;
}
);
}
Versions are as follows:
MyBB: 1.6.13
PHP: 5.4.26-pl0-gentoo
SQL: MySQLi 5.5.37
Currently there is only the capability to influence the post message during the parse_mesage
hook. We need to include parse_message_start
and parse_message_end
possibilities.
...you can just leave all the items unchecked and click Import
, but it isn't very intuitive and that is currently the only way out.
There a lot of lines of code just loading dependencies...
There are several segments of code in the ACP-side scripts that have inline JS which should be in external files.
Is there a way to make it so super moderators can use it too? A lot of the times moderators are the ones who accidentally delete a post/thread in which need it restored. But because its only available in ACP we have to wait for admins to log in to fix it.
Reported here: https://community.mybb.com/thread-203531-post-1258176.html#pid1258176
To reproduce, After installing YourCode, create a thread a post any complex url and use an apostrophe in the title:
[url=mybb.com]MyBB's Website[/url]
which should display:
but actually display's:
The error is caused by my failure to investigate changes to the parser class.
I just attempted to install YourCode and got the following error:
SQL Error:
1366 - Incorrect integer value: '' for column 'nestable' at row 1
Query:
INSERT INTO mybb_yourcode (`title`,`description`,`parse_order`,`nestable`,`active`,`case_sensitive`,`single_line`,`multi_line`,`eval`,`callback`,`regex`,`replacement`,`alt_replacement`,`can_use`,`can_view`,`default_id`,`dateline`) VALUES ('Format - Bold','MyBB Default Bold MyCode',10,'','1','','1','','','','\\[b\\](.*?)\\[/b\\]','<span style=\"font-weight: bold;\" class=\"mycode_b\">$1</span>','','','',1,1505928170)
I haven't exactly figured out why, but the parse was updated in MyBB 1.6.11 to separate internal MyCodes that use a callback for the replacement-- even though they are treated identically within the parser.
This should be as simple as ensuring that the callback
index of the mycode_cache
property of the parser is stored as an (empty) array.
I'll be getting this done in the next day or so.
Related to: WildcardSearch/MyBB-Helper-Classes#21
Table definitions are in a format compatible with MySQL and MySQLi, but PostgreSQL needs to be added.
The installation system used in this plugin installs its images for every theme, both forum-side and for the ACP. If those folders {admin_folder}/styles
(and its subfolders), and images
(and its subfolders) are not writable the images (and ACP style sheets) cannot be installed/upgraded.
The admin should be warned pre-install of the issue if it exists, and installation should be halted if the problem exists.
...this results in the user seeing the full URL for the edit link rather than a title.
Namespacing is a fairly new feature for PHP. I don't disagree with your using it, but for the sake of saving yourself major headaches, I'd personally make it very obvious that this plugin has minimum PHP requirements and would possibly add a check to install/activate too.
My sequence of events were...
made single post thread, deleted, restored thread, posted second post, attempted to delete thread again and got mysql error
MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1062 - Duplicate entry '2880' for key 'PRIMARY'
Query:
INSERT INTO mybb_backup_threads (tid
,fid
,subject
,prefix
,icon
,poll
,uid
,username
,dateline
,firstpost
,lastpost
,lastposter
,lastposteruid
,views
,replies
,closed
,sticky
,numratings
,totalratings
,notes
,visible
,unapprovedposts
,deletedposts
,attachmentcount
,deletetime
,tlink
,postpreview
,lastpostpreview
) VALUES ('2880','27','testing trashbin','0','0','0','1','metulburr','1492426282','15148','1492426345','metulburr','1','5','1','','0','0','0','','1','0','0','1','0','','','testing 2nd post')
yourforum/inc/languages/english/admin/yourcode.lang.php does not exist
I am not sure why this is happening. It is my understanding that if there is no admin/my.lang.php
, MyBB is supposed to look in the language_name
folder rather than reporting an error.
I'll probably just wind up separating all of the language into two files. :s
I need to version my helper classes because of the possibility of existing obsolete copies of them present in plugins that have not been upgraded on end-user forums.
Could you give us an example about YourCode? What is the different between YourCode and MyCode ? I'm confused.
There are several hard coded language strings in the file as well as functionality that depends upon hard coded English strings.
I installed YourCode a few days back. Just today, the shoutbox I have installed (MyShoutbox) decided to randomly stop loading so I tried opening up one of the static pages to view the shouts. The 'Full Shoutbox' page loads fine, but the psp/mobile page seems to throw a warning involving yourcode:
In the error log, I see the following:
<error>
<dateline>1393399020</dateline>
<script>inc/plugins/yourcode/forum.php</script>
<line>59</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>Creating default object from empty value</message>
</error>
Any idea what may be the culprit?
In MyBB's core code, $parser
is always a global variable, but in plugins, it is up to the author as to the scope. In fact, there isn't any good reason for plugin authors to create and use a global copy of the parser, but if they don't, YourCode will not work.
There isn't much we can do about what other plugin authors do, but a check needs to be implemented to prevent an error and needless execution.
Reported here: https://community.mybb.com/thread-203531-post-1255920.html#pid1255920
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.