Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Nao
7636
Features / Re: Template skeleton!
« on September 29th, 2011, 04:48 PM »
No, but you can rely on asking for it to be 'last', because feeds will be injected last...
Of course, we could also have two streams in each direction:
loadBlock('my_block', 'sidebar') would add a block in the normal direction.
loadBlock('my_block', 'sidebar', 'from_end') would add a block in the opposite direction.
So we'd just need to call loadBlock('sidebar_feeds', 'sidebar', 'from_end') ASAP, and then all 'from_end' calls will put the block above feeds. Of course, normal direction will mean it's always added between the current 'normal' position and the 'from_end' position.
7637
Off-topic / Re: Randomizing a jQuery slideshow
« on September 29th, 2011, 01:56 PM »
Did you try removing the class="show" from the HTML code on the first item...? Because at this point it has two show classes, doesn't it?
7638
Features / Re: New revs
« on September 29th, 2011, 01:27 PM »
rev 1039
(12 files, 18kb)

* Now caching the cache type for the lifetime of the PHP page. It also has the benefit of not doing strange things when a cache getter is enabled but a cache setter is disabled through php.ini, or things like that. Also optimized various areas of the cache. (Subs-Cache.php)

! This has got to be one of my best bugs in a long time. Last time I optimized the file cache code, I actually inverted a test, meaning that the caching logic was completely screwed up. Lulz!!1 (Load.php, Subs-Cache.php)

* Optimized getLanguages() to be a bit faster using glob() instead of scandir(), things like that. (Load.php)

* Always running getLanguages() for now. It takes a millisecond or so. Probably could use some optimization, but I'm going to be cool with that for now. Also centralized the test for isset($context['languages']) at the beginning of getLanguages(). (Load.php, ManageAddons.php, ManageBoards.php, ManageServer.php, Register.php)

- Removed $context['languages'][...]['selected'], as it's never used anywhere. (Load.php)

- Got rid of pointless features aeva_get_size() and max_dir_size. (Aeva-Subs-Vital.php, ManageMedia.php, Subs-Media.php, ManageMedia.language.php)

* aeva_get_num_files() actually did a recursive search when it only needed to get the current folder's number of files. Optimized 18 lines into 2. (Aeva-Subs-Vital.php)

* Upped maximum number of files in an album folder to 1500, once again. The common FTP limit for viewable files is 2000, and 1500 should allow for at least 500 items per folder, for a minimum of 250k avatars and attachments in the future system. Until we get to add an extra level of depth to the folder structure, of course. (install.sql)
7639
Off-topic / Re: Randomizing a jQuery slideshow
« on September 29th, 2011, 01:01 PM »
Where in the script did you put them...? Seriously, you didn't put anything into your script.

Noob! :niark:
7640
Plugins / [Naming poll] Re: Packages
« on September 29th, 2011, 12:58 PM »
Well, as per Wikipedia's definitions --
http://en.wikipedia.org/wiki/Plug-in_(computing)
Plugins (or Plug-ins :lol:) are considered to be the small software that adds features, while add-ons (or addons :P) are considered to 'include' plugins, themes and other elements that can be added to it, so basically you don't *have* to stop calling them 'add-ons', I think it's really up to anyone's taste...

The idea is that we offer an add-on area (which we'll have to name eventually, with a po... Sorry :P), which offers themes to download, as well as plugins. That's what SMF calls 'Modifications' on their website, except it should be 'packages' if they were faithful to their terminology... :P

So, basically, loadAddonSomething() should be loadPluginSomething() because that's really something for plugins only, not for themes. In a sense, we can (and should) find a clear line between plugins and addons. Both words have their space in Wedge and that's what the poll seems to be saying. :)

PS: add-on might be more 'approachable', but don't forget that the first target for add-ons is *webmasters*, and they're rarely complete noobs :)
7641
Features / Re: Template skeleton!
« on September 29th, 2011, 12:07 PM »
Quote from Arantor on September 29th, 2011, 10:31 AM
Bump for the above.
Oh... For John, not me :P
Quote
Also, is the feed block totally driven by the skeleton now rather than late-injected into the sidebar as it used to be?
It's still injected later.
The reasoning behind this is that we want to have the block at the very bottom of the sidebar. We could call it through sidebar_below(), though...
Quote
It just occurs to me that some of the things I want to do may well rely on the feed block of the sidebar for positioning/ordering.
Before feed block: that's how it behaves...
After feed block: any reason for wanting that...?
7642
Off-topic / Re: Randomizing a jQuery slideshow
« on September 29th, 2011, 12:04 PM »
What I'm saying is that I'm not seeing any randomization code in your HTML source...
7643
Features / Re: These two bytes may not matter to you...
« on September 29th, 2011, 12:16 AM »
We can't really test for images because AeMe can really hold any type of files anyway -- and the file extensions are gone, either way. I'm just trying to get it to be simpler. The problem with glob() is that it's not available on all servers, but OTOH if it's not, then Wedge won't work (Subs-Cache uses it.) I've done too much benchmarking these days, I hardly even trust it anymore... Just doing a long loop will usually not work well, because PHP will cache results internally I believe. For instance, $a[strlen($a)-1] is faster than substr($a, -1) when calling them thousands of times -- but substr is always faster on a single call. (e.g. if you modify the string dynamically...)

No, it's not used in ManageServer... Sigh.
As for getLanguages, I'm tempted to always call it, even with just the English files... lulz.

getid3 changelog:
http://getid3.sourceforge.net/source/changelog.txt
Hmm...
7644
Plugins / [Naming poll] Re: Packages
« on September 29th, 2011, 12:10 AM »
20 votes - most of our regular voters. We'll hardly get to more than 30 votes on this poll so I'm assuming the results are quasi-final, with a (very!) short victory for 'plugins'.
So basically, it confirms what I said before, and we're going to have a war between English and non-English speakers :P

Would like Pete's opinion on my post above.
7645
Off-topic / Re: Randomizing a jQuery slideshow
« on September 29th, 2011, 12:03 AM »
It works for me, but I wouldn't know about the random aspect of your item list..?
7646
Features / Re: These two bytes may not matter to you...
« on September 29th, 2011, 12:01 AM »
- aeva_get_num_files() function is seriously awful. It uses scandir() to iterate through the list of files and increment a counter.
There are plenty of ways of doing that in a single instruction -- e.g. the various ones here:
http://stackoverflow.com/questions/224408/return-total-number-of-files-within-a-folder-using-php
I don't know if it's worth it though... But on forums that heavily use the media gallery...

- selected: not only is this never used in Wedge, but it's set twice -- once in Load.php, and once in Register.php. It's set -- and never used after that...

Code: [Select]
if (!empty($modSettings['userLanguage']))
{
$selectedLanguage = empty($_SESSION['language']) ? $language : $_SESSION['language'];

// Do we have any languages?
if (!isset($context['languages']))
getLanguages();

// Try to find our selected language.
foreach ($context['languages'] as $key => $lang)
{
$context['languages'][$key]['name'] = strtr($lang['name'], array('-utf8' => ''));

// Found it!
if ($selectedLanguage == $lang['filename'])
$context['languages'][$key]['selected'] = true;
}
}

Remove or not...?

- getid3 is now at version 1.9.1, we're still at 1.7.9 (2 years old). I originally took a LOT of time to delete all of the PHP comments from getid3 -- there are so many, and sometimes so awfully indented, it's just a waste of space. I saved at least 20% of space by removing these. Problem is -- if I keep removing the comments manually, I can't update getid3 as easily as one would think... Meh. On the other hand, it's not like it needs to be updated a lot. I don't know.

Opinions welcome...
7647
Features / Re: New revs
« on September 28th, 2011, 11:41 PM »
rev 1038
(39 files, 27kb)

! get_boardindex hook didn't work as expected when not in include_categories mode. (Subs-BoardIndex.php)

* For consistency reasons, now using the official PHP syntax for variable referencing, i.e. "=&" instead of "= &". (38 files... Not listing them all. Not committing getid3 because it's version 1.7.9 and I need to update it to 1.9.1...)

* Commenazi. (Class-DBPackages.php)
7648
Features / Re: New revs - Public comments
« on September 28th, 2011, 09:56 PM »
- Does that mean I need to test your 3000 lines thoroughly? :P I'm kind of skipping through the large functions because they seem to be okay and I'm mainly focusing on the smaller things outside these functions, such as this... Please don't tell me I have to spend my week on that... :^^;: I still have 1600 lines left to check...

- Yeah, I remembered in the meantime: the official syntax is "$a =& $b", not "$a = &$b", because that's really "=&" and it basically says that $a is an alias to $b, and $b is an alias to $a just the same, so it's not really the same to PHP...
Posted: September 28th, 2011, 09:50 PM

There are some beautiful pieces of code in your table creation function, btw :)
7649
Features / Re: New revs - Public comments
« on September 28th, 2011, 09:38 PM »
+   $params = array(&$boardIndexOptions);
+   if ($boardIndexOptions)
+      $params[] = &$categories;
+   else
+      $params[] = &$this_category;
+   call_hook('get_boardindex', $params);

I'm assuming you meant to test for include_categories...?

Wouldn't that be simpler (and more accurate)?

Code: [Select]
call_hook('get_boardindex', array(&$boardIndexOptions, $boardIndexOptions['include_categories'] ? &$categories : &$this_category));
7650
Features / Re: New revs - Public comments
« on September 28th, 2011, 08:07 PM »
So, the original sentence is....?