YesNoOk

Show content

This section allows you to browse the content for this member. Note that you can only see content for which you have sufficient viewing permissions.

*
Suki is Offline
Contact Suki:

Suki

Full Member

Messages by Suki

    
Re: User tagging
 May 31, 2013, 19:33:26 View in topic context
avatar  Posted by Suki  in User tagging (Started by Nightwish October 28, 2011, 23:43:11
 Board: Showcase

I don't know, that would imply having a lot of potential calls to the server if the user is allowed to tag multiple times.  In this kind of cases where theres two options, having a very big query versus having multiple smaller queries I always tend to go for the big single query, specially if this query would be used across several users at the same time (since it would be basically fetching a text file). You can always put limits to the query if things get complicated or disable the ability to tag altogether.
    
Re: User tagging
 May 26, 2013, 12:21:58 View in topic context
avatar  Posted by Suki  in User tagging (Started by Nightwish October 28, 2011, 23:43:11
 Board: Showcase

Nope, I only fetch active users (is_activated = 1) and users with X post or more where X can be defined by the admin, other than that yes I fetch the entire table. I know this can be a problem with a large forum but then again most of the features on this mod will be a problem with a large forum.
1 Like It 
    
Re: User tagging
 May 25, 2013, 03:41:34 View in topic context
avatar  Posted by Suki  in User tagging (Started by Nightwish October 28, 2011, 23:43:11
 Board: Showcase

But how exactly do you perform the database lookups for the user names?

Its just a plain query to the users table, the query fetches the real_name ad the ID and return the data as a json file, the mention script fires an ajx call to this special action and it gets the daa in json format.

This special action handles all my ajax calls https://github.com/MissAllSunday/Breeze/blob/develop/Sources/Breeze/BreezeAjax.php via subactions it strips all data and headers before printing the response back.
    
Re: User tagging
 May 24, 2013, 17:24:13 View in topic context
avatar  Posted by Suki  in User tagging (Started by Nightwish October 28, 2011, 23:43:11
 Board: Showcase

Well, thats as far as I could go really, the script itself fires up an ajax call everytime the user types the @, thats cool for simple queries to text files or simple demo pages but for something real like a forum userbase thats just not possible as it would kill the server. Thats why I end up wrapping the ajax call to be fire up only on focus() , that alone drastically reduced the number of ajax request the script does, the retrieved data gets appended to the DOM so all the sorting and juggling are done on client side which is really a nice plus to have.

I certainly don't know how can it be optimized and I only had tested it on local and on my site so I still don't know how it will behave with a large userbase. The things I did to minimize server hits were based upon assumptions and common sense :P

What was really nice is that the script lets you output the data back to the textarea in any way you want, I chose this format because that was an easy way to get the data with regex but I know I could write the data back in a fancy and more stylish way like @username and pass the real data on some hidden post var then do the replace on parsing.

I tried the SMF autosuggest feature, perhaps it was me but I didn't find it easy to customize and besides it wasn't designed to work on textareas.

    
Re: User tagging
 May 24, 2013, 14:19:32 View in topic context
avatar  Posted by Suki  in User tagging (Started by Nightwish October 28, 2011, 23:43:11
 Board: Showcase

yeah, most likely a spam user :(

Anyways, for my neeeds I end up using a really nice plugin for notifications: https://github.com/ichord/At.js

The script fetches a list of possible eligible users whenever the textarea is focused using jquery focus() (of course the list is cached) the query returns a json list of users, the noty then inserts the data using a predefined format @(username, ID)  that can be easily converted to a link when parsing. Thats how I solved the space on names issue, of course having a lit of possible users whenever you type @ sure is a nice plus to have :)
    
Re: got some install problems
 May 18, 2013, 12:05:16 View in topic context
avatar  Posted by Suki  in got some install problems  (Started by samozin April 20, 2013, 10:03:03
 Board: Testing Board

Cool, I noticed the 404 pages too, anyway I'm glad this isn't dead :)
1 Thank You 
    
Re: got some install problems
 May 18, 2013, 00:20:27 View in topic context
avatar  Posted by Suki  in got some install problems  (Started by samozin April 20, 2013, 10:03:03
 Board: Testing Board

yay  you're back :)  I noticed you were gone from github and for a moment I regret that I never really got a chance to play with EoS  but I'm glad you're back :D
    
Re: To twig or not to twig
 February 24, 2013, 01:35:40 View in topic context
avatar  Posted by Suki  in To twig or not to twig (Started by Nightwish June 22, 2012, 23:05:24
 Board: EosAlpha Bulletin Board System - development

Well, in my case I also discovered that twig doesn't play nice with code that doesn't follow proper MVC patterns :P   my blog pages had too much code that should be in a controller but I was lazy and I only wanted to try out silex so I didn't care that much about that.

I don't know if forum templates can be light enough for a template system to really works without issues, a forum by definition holds lots and lots of data, as much as you cleverly show stuff or try to keep as less logic as possible, there will still be lots of data to display and lots of logic that just can't be moved out of the view, unless you have control of absolutely everything which somehow reduces the possibility of what can be done with the software itself (extensibility, scalability, plugins, themes, all that stuff.)

I agree with re-usage, I always wondered why SMF have separate templates for private messages and normal messages since they are the same, I also wondered why the user info in messages was printed with every message, that is static data that is been fetched and displayed multiple times, you can have a separate template for that and just call the template one time and print it as many tmes as you want/need.
1 Like It 
    
Re: To twig or not to twig
 February 22, 2013, 13:52:48 View in topic context
avatar  Posted by Suki  in To twig or not to twig (Started by Nightwish June 22, 2012, 23:05:24
 Board: EosAlpha Bulletin Board System - development

oh! I wish I had read this before :P I also take a look at twig and had the same results, I jut checked it against an experimental blog code, using a framework contributed to the slow times as well.

As much as I personally like the default SMF template system (not because is easy to use but because is pretty much the only template engine I ever used) I also can see the benefit (for themers) of using an "inverse" method, aka, wordpress template where PHP is inside HTML. But thats somehow ugly and I def wouldn't want thousands of <?php ?> tags just filling up space.

As for template engines like smarty or twig, I have mixed feelings, when I see a twig template, my mind immediately goes "oh, yet another pseudo code and syntax  I need to learn", perhaps it is just me being reticent, I still need to find a cute HTML template and port it over to twig code to see if I'll ever be interested on it.

And I agree, the templates def needs to lose some weight if they want to fit in a pretty and fashion twig engine :P  that not only applies for normal templates but for mobile versions as well, there is just too much displayed data that makes it terrible difficult to implement a really nice, clean and objective mobile version.
    
Re: User tagging
 July 12, 2012, 14:21:46 View in topic context
avatar  Posted by Suki  in User tagging (Started by Nightwish October 28, 2011, 23:43:11
 Board: Showcase

* Suki ignores the warning because I'm sure I want to reply :P

I'm doing this with a slightly different approach, instead of @@ or some other customized character the username would be wrapped in {} as in {Suki} that is actually because I'm lazy and I don't want to implement the SMF auto-complete thing when an user starts typing a @ nor do I want to implement customizable characters :P

I like all of your ideas, allow me to "borrow" them :P
    
Re: How template hooks work
 July 10, 2012, 03:06:55 View in topic context
avatar  Posted by Suki  in How template hooks work (Started by Nightwish July 09, 2012, 16:50:42
 Board: Hook documentation

Very interesting! I'm interested on this myself (plugin system + hooks), for sure watching how exactly you do this will be a tremendous help for me :)
1 Like It