26

(119 replies, posted in PunBB 1.3 extensions)

Why not add hooks instead of adding tons of features?

27

(17 replies, posted in PunBB 1.2 discussion)

You wanted our opinions?

My opinion is that MyBB is the best forum there is, if it's MyBB you want. If it's PunBB you want, then why bother with MyBB, as it's clearly not made to do the same things. Apples and pears, for short.

28

(19 replies, posted in PunBB 1.3 troubleshooting)

StevenBullen wrote:
intedinmamma wrote:

One solution is to have a "proxy script", which just adds the CSRF token and sends it all along to wherever it should go.

Will this work on 100% of what PunBB 1.3 will work on? I am positive not all people/hosting lets you run proxy scripts etc.

It should be quite easy as long as you can use fsockopen(). (available in both PHP4 & 5) Doing it that way you will just have to resend the POST data along with a CSRF token, check php.net for examples on doing the harder half of it.

29

(19 replies, posted in PunBB 1.3 troubleshooting)

StevenBullen wrote:

Any idea of a way around this?

intedinmamma wrote:

One solution is to have a "proxy script", which just adds the CSRF token and sends it all along to wherever it should go.

smile

30

(25 replies, posted in PunBB 1.3 troubleshooting)

Lucas Malor wrote:

esting link: an Ajax framework for PHP under development, that do not need Javacraps at all ^_^ (whops, forget this, I wrong. It do not need js coding sad)

http://tigermouse.epsi.pl/

That's not an AJAX framework (like prototype/jQuery), it's an application framework. (like CakePHP, Symphony, etc...) And very few of those requires any JavaScript coding to be able to use AJAX. smile

31

(25 replies, posted in PunBB 1.3 troubleshooting)

Lucas Malor wrote:

But I think this would be a lot better as an extension, and done with unobtrusive JS instead

It's also my opinion. But if you want to be 100% compatible you must use PHP instead of XmlHttpRequest

If you want to be 100% compatible you shouldn't use JS at all, as there are browsers that doesn't support it. wink

32

(25 replies, posted in PunBB 1.3 troubleshooting)

AJAX = Asynchronous Javascript And XML, this solution is more like AJAH. ((X)HTML instead of XML)

But I think this would be a lot better as an extension, and done with unobtrusive JS instead. *strong semi-elitistic opinion*

Edit: Dämmn, elbekko was faster. tongue

Sounds like a pretty simple extension.

34

(6 replies, posted in PunBB 1.3 troubleshooting)

One solution is the one I came up with for Publish Topics:

if (!isset($lang_topic['Unpublish']))
        $lang_topic['Unpublish'] = 'Unpublish';

Doing it that way makes it possible to put translations in extensions. If someone makes a system for automatically keeping extensions updated then it won't be very hard to "push" translations of extensions.

35

(19 replies, posted in PunBB 1.3 troubleshooting)

One solution is to have a "proxy script", which just adds the CSRF token and sends it all along to wherever it should go.

36

(151 replies, posted in PunBB 1.3 extensions)

Rickard wrote:

Anyone else have an idea?

if(count(array_intersect($perms_new, $perms_old)) != count($perms_new))
{
    if(count(array_intersect($perms_new, $perms_default)) == count($perms_new))
    {
        // Delete
    }
    
    else
    {
        // Insert/Update
    }
}

It should be quite easy to build the queries and the form directly from $perms. If done right, you will just have to add elements to $perms and $perms_default to add permissions. Forms, validation and queries are so similar that it will work most of the time, and when it doesn't you can always use some other hook. Depending on how it's all implemented you might have to use array_intersect_assoc() instead of array_intersect(), as the latter doesn't care about indexes.

37

(151 replies, posted in PunBB 1.3 extensions)

Hooks for adding permissions in admin/forums.php.

Well, I think the topic kinda says it all. Most extensions won't be more than a manifest.xml, so it feels a little unneccesary (spelling) to have a folder for just one file. The only problem I can think of is that you can have two extensions with the same ID, but it must be possible to solve somehow. smile

Rickard wrote:
intedinmamma wrote:

And that's beacause I thought that $db->add_field() did that automagically. Update is on the way. smile

I considered doing that, but decided not to so that the functions can be used with other tables as well.

I was just about to start whining about it, until I came to the same conclusion.

qubertman wrote:

I am not able to install because it is not detecting the table's prefix.

And that's because I thought that $db->add_field() did that automagically. Update is on the way. smile

StevenBullen wrote:

When I install it only shows me one forum. You can check it out at http://pundemo.org
No other mods installed that can mess with it so thought I would let you no.

Dämmn, must be related to that I haven't tested with SVN, just the Beta release.

Allows Admins and moderators to publish topics to the front page. Also adds RSS/Atom feeds for published topics. Publish by clicking the "Publish" link next to sticky/close topic after installing the extension. Install by putting manifest.xml in a folder named "publish_topics" in the extensions folder.

Download here, demo here.

For 1.0:
Permission for publishing, so not every moderator can publish (if wanted)
Make the topic listing on the front page prettier (idea's welcome!)
Turn the hard coded number of topics on the frontpage (which is 3) into a setting
Maybe an archive for older published topics?
Better support for URL rewriting

Edit: Oh, forgot to mention that I'm not sure about how to handle translatable strings and the url rewriting. Is there anything decided yet?

Edit again: It now supports installations with a table prefix. The old file has been replaced, and can be found via the link above.

Why not do it apt-get style and allow third party repositories? There's already functions available in PunBB for reading XML files and retrieving files from other servers, so some of the work is already done.

44

(37 replies, posted in PunBB 1.3 extensions)

SuperMAG wrote:

amazing ... but in the next release remove the stats bar ... and rename the simple_gallery.php and all the releated files to gallery.php .... and also remove the (Powered By Lytebox) etc .. and also where is upload and delete image buttons ...

Or do it yourself. wink

elbekko wrote:

That's hell to type out every time tho >=(

But you don't have to have foobar as ID even if the extension is named foobar, you can always use fb. (as long as you're the first one to use it)

Taimar wrote:
intedinmamma wrote:

That feels a little awkward to me, as I expect anything that turns the pointer into a pointing hand to be a link.

Buttons are similar to links: they are clickable and do something and/or direct you somewhere.
Anything that's clickable should IMO have the hand cursor come up...

I'm not talking about how things should be, I'm talking about what I'm used to. wink

That feels a little awkward to me, as I expect anything that turns the pointer into a pointing hand to be a link.

48

(18 replies, posted in PunBB 1.3 troubleshooting)

Smartys wrote:

If your extension needs a page, it can write a page

Or you can put the page as a php file in the extension folder and use the URL rewriting system to make it appear wherever you want it. (as long as the rewriting system is in use) Or use misc.php, it's got a hook called mi_new_action that would do the job.

49

(151 replies, posted in PunBB 1.3 extensions)

array_insert() exists in functions.php, so it's there. smile

//
// Inserts $element into $input at $offset
//
function array_insert(&$input, $offset, $element)
{
    // Out of bounds checks
    if ($offset > count($input))
        $offset = count($input);
    else if ($offset < 0)
        $offset = 0;

    array_splice($input, $offset, 0, 0);
    $input[$offset] = $element;
}

But unless I'm totally wrong (this time to), this won't insert an element at position 5 if there's only 3 elements in the array.

50

(151 replies, posted in PunBB 1.3 extensions)

Smartys wrote:

Look into the array_insert function? wink

Forgive me if I'm wrong, but doesn't $array[] = 'value' add an element at the very end of the array? So even if I put my "Death Ray Control Panel?" at, let's say, position 3 (which I fail to see how it would be possible, cause there's no 0, 1 or 2), then adding elements would put them in position 4, 5, and so on... Honestly, I'm far from a PHP Guru, but this is how I always have thought arrays work. smile