Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Plugin update coming.

  • 13-06-2008 8:01pm
    #1
    Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭


    I am going to rework the boards.ie PM plugin (as FF3 is out Tuesday). I have set up a competition to get the artwork redone. Hopefully someone actually does something. :)

    To make it a bit better on traffic to boards.ie though would it be possible to create a page with the following information.

    Total number of unread messages.
    Total number of messages.
    Total number of Subs with updates.
    Total number of Subs.

    The page should only be accessed if the user is logged in.

    JSON format would be best as it means if you need to add any other fields at a later date it won't break anything. But if you have any other suggestions I can work around.

    Appreciate any help. :)


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Ok here is my suggestion for JSON format.
    { 
    	"info":	{
    		"totalPM" : "0",
    		"unreadPM" : "0",
    		"totalSubs" : "0",
    		"newSubs" : "0"
    	},
    	"url":	{
    		"gotoInbox" : "/vbulletin/private.php?folderid=0",
    		"gotoNewPM" : "/vbulletin/private.php?do=newpm",
    		"gotoSubscriptions" : "/vbulletin/subscription.php?do=viewsubscription",
    		"gotoUserCp" : "/vbulletin/usercp.php?"
    	},
    	"system": {
    		"minScanTime": "5",
    		"disable" : "false",
    		"sysUrlMessage" : ""
    	}
    }
    

    info = This is the main part of numeric data that is displayed to user.

    url = These are alternate urls. I have put in what I look up related page when user clicks menu item. However for normal sending leave the fields as "". This can be used to override the menu lookup function. For example say you want "Open PM" to go to a different page temporary.

    The "www.boards.ie" is coded as a variable so can't be sent via JSON.

    system = These are settings for the admin to make to the plugin. When I do the lookup for the JSON file I can pass over the version number of the plugin. If there is a serious update means you can disable older plugins and send them to a new page informing of update.

    system.minScanTime = set to 5 mins minimum in the plugin but the users can cheat and override this. Setting at admin side can stop this. Or if you need to change later to a higher number.

    system.disable = boolean. Physically disables the plugin from working. I would prefer this does not work without boardsie.system.sysUrlMessage being set.

    system.sysUrlMessage = Will open that URL when the plugin initialises. For sending important announcements to the plugin owners. Like plugin update or maybe a downtime message coming up?


  • Subscribers Posts: 9,716 ✭✭✭CuLT


    Looks good, will brush up on my JSON this week.


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Add one more to system..

    "system": {
    "message" : ""
    }

    If this is set then I will have the plugin do some kind of message to the user. That way if the server is due to go down or there is a known outage it can be recorded into the plugin. Rather then people randomly walking around the net wondering where boards.ie has gone. :)

    It will keep the last message until its blanked or updated.

    Just noticed...

    "disable" : "false",

    should be "disable" : false,


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Current status.
    - Plugin re-coded for FF3 only.
    - Themes added (two winning designs and previous design).
    - Preferences page updated.
    - About updated.
    - Complete Build environment made up in Eclipse so means updating will be a doddle.
    - Debugging option added (based on config setting).

    Outstanding my end.
    - Need to test JSON access (will be doing on local server first).
    - To work out Signing.
    - AJAX trapping to be added.
    - System controls to be added.

    Buttons for top bar will be optional later.

    Sample screenies (one of the themes).

    Tools Menu.
    58263.jpg

    Popup menu.
    58264.jpg

    Add-ons menu.
    58265.jpg

    About screen.
    58266.jpg


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Current status.
    JSON tested and works fine on test server. This is the final JSON layout.
    { "info" :	{
    		"totalPM" 	: 0,
    		"unreadPM" 	: 0,
    		"totalSubs" 	: 0,
    		"newSubs" 	: 0
    	},
    	"url" :	{
    		"gotoInbox" 		: "/vbulletin/private.php?folderid=0",
    		"gotoNewPM" 		: "/vbulletin/private.php?do=newpm",
    		"gotoSubscriptions" 	: "/vbulletin/subscription.php?do=viewsubscription",
    		"gotoUserCp" 		: "/vbulletin/usercp.php?"
    	},
    	"system" : {
    		"minScanTime"	: 5,
    		"disable" 	: false,
    		"sysUrlMessage" : "",
    		"message"	: ""
    	}
    }
    

    If the first 8 characters don't match then it throws it out as something is wrong and won't eval. (quick way to check).

    Plug will only disable itself by system if sysUrlMessage or message has a value (so users know what is going on). sysUrlMessage will only load the page once everytime FF loads and has made a call to server. If the URL changes then it will display the new page.

    url sections can be blank to save traffic (eg. "" instead of "/vbulletin/private.php?folderid=0" ).

    When making the AJAX call I pass over to the server the version number of the plugin and a timestamp (timestamp is to bypass browser caching).

    [update] I've added toolbar buttons but there is a known issue with small/large icons. But leaving it that way for the moment.

    Outstanding issues
    - Need to test JSON output on boards. (Cult handling this bit).
    - Figure out signing process.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    OK This version does not check for subs/new messages but everything else should work. I am still waiting for Cult. But if people want to try you can download from here.

    https://addons.mozilla.org/en-US/firefox/addon/7787

    As it is in the sandbox you need to create a mozilla account on that site to download.

    Once everything is working will deal with the signing at that point.


  • Subscribers Posts: 9,716 ✭✭✭CuLT


    Sorry Hobbes, didn't get to look into it much last week.

    This is my first attempt at formatting JSON, so let me know if it's broken or wrong:

    http://developer.boards.ie/api/inbox/json


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Cheers. Couple of bugs. If you look at post 6 and compare it will give you what to output.

    Having a look, you have a couple of } and , missing in key locations. So it won't eval for me. Also

    "totalPM":"559",
    "unreadPM":"0",

    should be numeric, not strings. so..


    "totalPM": 559,
    "unreadPM": 0,
    and

    "disable":"false"

    should be boolean.

    "disable" : false

    and
    "minScanTime":"5"

    should be numeric.
    "minScanTime" : 5

    all the URL parts appear to have \/ instead of /


    ... btw, love the URL very cool idea. :)


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    You can probably set the JSON to text format as well so it can be read in a browser rather then having to save to disk. "text/html" ?


  • Subscribers Posts: 9,716 ✭✭✭CuLT


    Hobbes wrote: »
    Cheers. Couple of bugs. If you look at post 6 and compare it will give you what to output.

    Having a look, you have a couple of } and , missing in key locations. So it won't eval for me. Also

    "totalPM":"559",
    "unreadPM":"0",

    should be numeric, not strings. so..


    "totalPM": 559,
    "unreadPM": 0,
    and

    "disable":"false"

    should be boolean.

    "disable" : false

    and
    "minScanTime":"5"

    should be numeric.
    "minScanTime" : 5
    Fixed.
    Hobbes wrote: »
    all the URL parts appear to have \/ instead of /
    This seems to be enforced by the JSON PHP functions, not quite sure how to get around this yet, quite annoying if it's not a standard way to treat URL strings.
    Hobbes wrote: »
    ... btw, love the URL very cool idea. :)
    Cheers, hoping to make it a useful resource :)
    Hobbes wrote: »
    You can probably set the JSON to text format as well so it can be read in a browser rather then having to save to disk. "text/html" ?
    Was going with the application/json for content-type, but if text/plain works, that's fine.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Ok the data compiles. If you can't fix the \/ I can code around this.

    Will update plugin later today and will let you know. Cheers.


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    The \/ is perfect. javascript converts it fine.

    OK I am going to upload the working version shortly. It will remain experimental for the moment as I have other changes to make. Mainly.
    - About screen to be changed.
    - May change how the toolbar buttons work to allow icon in toolbar.
    - Will add option to point to version thread in preferences.

    Will start a thread related to the build so I can track issues. When ready.


  • Subscribers Posts: 9,716 ✭✭✭CuLT


    Cool, glad it parses correctly because I was scratching my head over it. Didn't really want to write my own JSON library if at all possible :)


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Ok created new thread. You can lock this thread now please. :) prefer if people write to the new thread


This discussion has been closed.
Advertisement