Show Likes

This section allows you to view all posts where this member received or gave a like to.

1
Off-topic / SurfaceThemes ...is what I do!
« on February 22nd, 2014, 09:26 PM »
If anyone cares to see, the damage I can do to an SMF theme? You may visit at your own risk:

Not too good with theme names there also crazy!

http://surfacethemes.com/smf/index.php?action=forum

I started working customizing theme of others, for their user request like; PHP Nuke and Postnuke, Crip and Bloc and more.. and my own on request, But mainly just like messing with them as a hobby lol! :) I'm toying with theme of other CMS systems also, but out of sight!

regards,
MadHat Maxx
2
The Pub / Re: What I LIKE in Wedge!
Norodo « on January 22nd, 2014, 02:25 AM »
It's being developed by the coolest developer I know. I really like how it looks and feels when installed :)
3
Development blog / That'll do.
Nao « on January 21st, 2014, 04:08 PM »
And here it is. I wanted to postpone it even more... But you don't deserve it. If anything goes wrong, I'll deserve it. In the meantime, please enjoy this; some of you have been waiting over three years for this moment.

https://github.com/Wedge/wedge

Read the README for instructions.
I will attempt to release a public alpha once I get some feedback confirming that everything's working all right.

https://github.com/Wedge/plugins

This is the official plugin repository. Most of these were written by Pete, John and Shitiz. The current license for them is the Wedge license; eventually, though, my goal is to make it clear which plugins are under more permissive licenses. Perhaps I'll even be able to make them all MIT, or something. If you write a plugin and don't want to share it under the MIT license, you can always push it elsewhere.

https://github.com/Wedge/languages

This one isn't a new repo, I introduced it recently on this blog, but what's new is that all of its files are now governed by the MIT license.

Lastly, if you're planning to make the switch to Wedge from an active SMF forum, please remember this:
  • There is currently no 'proper' importer available. Pandos confirmed to me that the official importer is broken, so I'll look into it ASAP.
  • Said official importer will be pushed to the Wedge/tools repo (or its own repo) when available. I'm planning to have it around by next weekend at the latest.
  • If Thorsten looks into it before I do (I know he loves this kind of thing), then he may fix the importer before I do. See? A programmer's logic is no more complex than yours.
  • It's still an alpha, even three years in. Meaning nothing is set in stone, and if a change I make breaks your forum, you can't complain to me. And if it makes it better, then you can't complain either. That was the whole point, after all.
Now, please allow me for a short break, before I jump into new adventures with you all.

4
Off-topic / Re: A short script to remove unused, useless globals in PHP.
« on November 16th, 2013, 11:57 AM »
Very interesting! I have been lazy with this..well, some time ago I started being more observant in my own functions, but I haven't touched any of the SMF native in this manner.

The results I got..(differs from yours? could be my changed script..?
Protendo    2088     its built on SMF 2.0.x so to be expected I guess. Still bad though.
Wedge    542     but I suspect your current working copy have even fewer.
Elkarte    83     Could be from using more OOP perhaps?
SMF2.1    1231     not bad really, but still behind Elkarte/wedge
Silvercircle    1316     not bad
SMF 2.0.6    2500     this I expected hah!


(is there some styling in the table tag in wedge btw? I added a few basic color schemes in Protendo,in  a new table-like tag with headers and title as well, very useful for me at least :D ).

Having unused globals takes memory, right? Thats the main point in removing them?

oh, and I added some to the script to read the results better(for me) so it now just reads:
Code: [Select]
<?php

$i 
0;
find_unused_globals(dirname(__FILE__));
echo 
'<hr>total: '.$i.'';


function 
find_unused_globals($dir)
{
global $i;
$files scandir($dir);
foreach ($files as $file)
{
if ($file == '.' || $file == '..' || $file == '.git')
continue;
if (is_dir($dir '/' $file))
{
find_unused_globals($dir '/' $file);
continue;
}
if (substr($file, -4) != '.php')
continue;
$php file_get_contents($dir '/' $file);
preg_match_all('~\n(\t*)function ([\w]+)[^\n]+\n\1(.*?)\n\1}~s'$php$matches);
foreach ($matches[3] as $key => $val)
{
preg_match_all('~global ([^;]+);~'$val$globs);
$glos = isset($globs[1]) ? implode(','$globs[1]) : '';
preg_match_all('~\$[a-zA-Z_]+~'$glos$there_we_are);
$val str_replace($globs[0], ''$val);
if (isset($there_we_are[0]))
foreach ($there_we_are[0] as $test_me)
if (strpos($val$test_me) === false)
{
echo '<div style="margin: 1px 0; border: solid 1px #aaa;background: #eee; padding: 5px 10px;">Unused global in '$file':'$matches[2][$key], ' -- '$test_me"</div>";
$i++;
}
}
}
}
5
Off-topic / A short script to remove unused, useless globals in PHP.
Nao « on November 16th, 2013, 01:03 AM »
As mentioned in the thoughts area, I quickly wrote a script to find unused variables declared with the global keyword in your PHP scripts.

Just copy this into any PHP file, drop it at the root of your website install, and have fun! It's not 100% tested, but it seems to be working fine, so I thought I'd share it, if only because SMF needs to do something about their 1600+ unused globals. I know they don't take much processing power or anything, but it just sounds lazy to me to leave globals that are unused.

Feel free to improve it as you like!
I'm releasing this under the WTF Public License, for what it's worth. It's not long enough to even bother with a MIT license, although I dream of using that one in the future... :P

Code: [Select]
<?php

find_unused_globals
(dirname(__FILE__));

function 
find_unused_globals($dir)
{
$i 0;
$files scandir($dir);
foreach ($files as $file)
{
if ($file == '.' || $file == '..' || $file == '.git' || $file == 'other')
continue;
if (is_dir($dir '/' $file))
{
find_unused_globals($dir '/' $file);
continue;
}
if (substr($file, -4) != '.php')
continue;
$php file_get_contents($dir '/' $file);
preg_match_all('~\n(\t*)function ([\w]+)[^}\n]+\n\1(.*?)\n\1}~s'$php$matches);
foreach ($matches[3] as $key => $val)
{
preg_match_all('~global (\$[^;]+);~'$val$globs);
$globs[1] = isset($globs[1]) ? $globs[1] : array();

foreach ($globs[1] as $find_dupes)
{
$dupes array_map('trim'explode(','$find_dupes));
if (count($dupes) > count(array_flip(array_flip($dupes))))
echo 'Found duplicate globals in '$file':'$matches[2][$key], ' -- '$find_dupes"\n";
}

preg_match_all('~\$[a-zA-Z_]+~'implode(', '$globs[1]), $there_we_are);
$val str_replace($globs[0], ''$val);
if (isset($there_we_are[0]))
foreach ($there_we_are[0] as $test_me)
if (strpos($val$test_me) === false)
echo 'Unused global in '$file':'$matches[2][$key], ' -- '$test_me"\n";
}
}
}

To do the opposite operation (i.e. finding globals that weren't declared in a global keyword) isn't going to work with a short script -- unless you only look for the 'usual culprits' ($context, $txt, etc), in which case, yes, a short script is doable, I guess. But for that, I'm using HHVM. It's working fine, and is very smart about it. Only problem, it only works on Linux, so I had to install a VM to run that VM. Amusing. And install tons of dependencies. And go through many more steps of the program not wanting to run (the joys of permissions), then not wanting to start operating (the joys of parameters), then not wanting to complete (the joys of JSON bugs in Ubuntu.)
It took me several hours to go through it, but I found over 400 documented 'bugs' in Wedge, some of which I believe are in SMF/Elk as well, not that many though, but I'll try to document those I find important for them to fix.

:edit:
- Fixed most single-line function declarations.
- Added a 'duplicate global definitions' part. If you have a line that says global $txt, $context, $txt, the script will now tell you about it.
6
I guess I can air what I think?

Arantor is a great programmer, though I find him to really hypocritical as a person with the recent events.  I had to laugh when remembering this thread after hearing the news that he came back to SMF.  Though, whatever, anything to make him happy?  I have to be honest, I felt like I was walking on eggshells when he was around here.  I felt as if I asked a question or offered an idea that he would pound me into the ground, mostly due to the fact that I am nowhere near his repertoire of programming.  I learn along the way to benefit myself and my sites; confronting problems takes me to task but I always learn something new about php, css, html, ect along the way.

Yes, I did offer 100 dollars to the Wedge project instead of throwing it at a forum license for v.bulletin.  Wedge fits the structure I want for my websites perfectly (especially with the unique privacy features, something my main forum really works upon), and I plan on using it in lieu of WordPress.  Yet even after saying all of that, I feel really bad.  I feel like I am leeching off of Nao's (and in essence Arantor's) hard work, hard work they pretty much did for free.  100 bucks is a drop in the bucket considering how many years was put into wedge.  Wedge is priceless and I am hopeless as to how to give back efficiently.
7
Features / Re: Soft merging of posts
Nao « on August 19th, 2013, 12:58 AM »
(No one around anymore..? :P)

A small bug... You need a post sent by a guest, or someone with no avatar and no user details.
Go to that post, so that the user name is position:fixed, and hover the name. The menu is shown above everything as expected, but below the user name of the next message. This shouldn't be happening, but stacking contexts are so fucking complicated when you start positioning stuff...

I'm guessing, the only fix for that is to have the menu HTML in a div outside of the main HTML page, and absolutely position it relative to the document itself, but the very reason why I avoided that, is because all hell breaks loose when you start modifying the username's position without hovering out of the menu.

I'm marking this as a cantfix for now, but all suggestions are welcome... Of course.
8
Off-topic / Re: Food for thought
Arantor « on August 8th, 2013, 07:01 PM »
Note the key point that the author makes, more than once, that some of this stuff is relevant for developers and that alternatives should exist for developers, e.g. in the dev tools area. But not in the main options. Perhaps not in a UI at all, just in the about:settings area, or exposed via a plugin for developers.

Turning off cache... funny you should say that. How many times have we asked people to hard refresh Wedge? Yet there are semi regular CSS changes... answer: we generally don't because we have a system that pushes a different 'filename' to the browser so it won't be cached. As a rule you should assume that a user will have a given thing cached and if that's a problem, rename the thing. One suggestion I've seen was to have files include the date of release in them.

Telling users to turn off cache is generally a really silly thing to do because it's not a per site cache. It's browser-wide meaning that everything everywhere has to be redownloaded. Which for a per-site exception is ridiculous. And the fact that the site owner has control over how they send you things means they're the ones who should be responsible for dealing with it - if you routinely have to tell users to empty their cache, you're doing it wrong. (I'm not even sure why we had to ask users to hard refresh with the smileys, actually... it certainly surprised me that we had to)

As far as turning off SSL/TLS goes, that's a classic example of the point the author is trying to make... who would legitimately turn it off? Anyone who is smart enough to know to turn off SSL or TLS should know how to do so via an about:settings type page. There is no reason I can see for having it as a UI item, especially not a fairly prominent one.
9
Other software / Re: SM.org compromised
Arantor « on August 5th, 2013, 07:47 AM »
Yeah, the turnaround was pretty good - far better than most I've otherwise been involved in (usually on the clean-up side, sigh)

Changing passwords on a regular basis is not necessarily a good plan. It prompts people picking easier-to-remember passwords.
10
Off-topic / Re: Post count fever
Nao « on August 4th, 2013, 05:43 PM »
Of course. Non-admins see their posts automatically hard-merged if they're sent less than 5 minutes after the previous one.