Remove the search bar restrictions on the wiki

Discussion in 'Suggestion Box Archives' started by Unoski, Apr 15, 2015.

  1. I am not sure how much control, which I know is not that much, Aikar has control on this stuff.

    Right now, the restriction does not let you use words that are 3 letters are less, meaning the following will happen.

    Voter's Diamond Hoe > Voter's Diamond
    Appeal a Ban > Appeal
    Banks Are Not Allowed > Banks Allowed
    IRC Chat > Chat
    Blizz Ard > Blizz

    As you can see, this will ruin a lot of things when you search the wiki. I was wondering if Aikar could remove the restriction so the wiki search tool is actually 100% usable.
    Tuqueque, 607, tinkao and 5 others like this.
  2. Wait there's a search bar?! o.o :p
    Tuqueque, zervados and tinkao like this.
  3. Also due to the 3 letters thing, Appeal a Ban would just be Appeal since Ban is also a 3 letter word :p
    Tuqueque, zervados and ShelLuser like this.
  4. The entire wiki search needs an overhaul. It's hard to find specific items (they're 5-6 down on the list) even if you type the exact item name.
    Tuqueque, FDNY21 and zervados like this.
  5. The search system uses the same basics of Xenforo. I just looked at what options we can change and they are only the following:
    • Search results per page
    • Maximum number of search results
    • Disable Search Engine
    Tuqueque, ShelLuser and zervados like this.
  6. I believe they have plans to make it on another format type thing, like the blog.
    I asked a staff member (I forgot who) about why the thing I want is on the 100th page and they replied "It is in alphabetical order, we cannot do much" or something along those lines.
  7. Can't Aikar code a new option? [/joke]
    deathconn likes this.
  8. The unfortunate thing is that the paid upgrade for Xenforo's (crap) search is too new to work on EMC's old version of Xenforo. :(

    Tip: *'s get you around the limit without messing up the results. Eg: appeal *a** *ban*. Just make sure that you have enough *'s per word to make them 4 letters+.

    Current search order is based on edit order instead of anything sensible, IIRC.
    607, sambish20, jkjkjk182 and 2 others like this.
  9. <-- almost has an entire forum system made from scratch already

    You guys would be saving a lot of money, and removing limitations, if you'd ditch xenforo
    Gawadrolt likes this.
  10. And add a stupid amount of development time, bugs, instability, loss off features, lack of support, lack of community made addons for the future, the need to migrate posts etc. over to new software, SEO being messed up by link format being changed, accounts having to be converted to new software, users having to get used to the new setup which is bad UX and confusing, probably a loss of stuff like report history since that's a pain to migrate generally, a harder admin panel to use than Xenforo's pretty damn easy one (for simple features like creating new forums), and basically, a ton of problems for pretty much 0 benefit. :)

    I'd be willing to say an "entire forum system made from scratch" isn't very comparable to Xenforo's features, either.

    Also, saving money? Xenforo's renewal cost is VERY minimal...
    607, Sambish, PenguinDJ and 3 others like this.
  11. XenForo is by far the most powerful and extensible piece of forum software there is. It might have a fairly steep learning curve, but once you've got the hang of it, you can basically modify it to the point that you could call it something else.

    Plus like Jack said, the renewal cost of Xenforo is $40 per year if you want updates and support, otherwise don't pay at all and keep using the version you've got.
    sambish20, SkyDragonv8 and JackBiggin like this.
  12. While I still seeing the search bar being largely useless, this sure would have been nice to know before. lol
    SkyDragonv8 likes this.
  13. It's more than comparable, because it doesn't have limitations - and you don't have to pay...

    with profiles, you just have to add a profile theme and add an sql lookup on the profile php based off of what is typed in the url example: empireminecraft.com/?member=Elite ...that would return the variable member is elite ... it would look up if elite exists on database... if it does then redirect us to an actual user page

    Code:
    <?php
    if(isset($_GET['member'])){
    $member = $_GET['member'];
    }else{
    $member = "";
    }
    
    require('./db/conn.php');
    dbconn($db_host, $db_name, $db_user, $db_pass);
    
    if ($member == ""){
    //no user specified
    //display all users
    
    }else{
    $SQL = "SELECT * FROM `Members` WHERE `username` = '" . mysql_real_escape_string($member) . "'";
    $Result = mysql_query($SQL);
    $Row = mysql_fetch_assoc($Result);
    if(mysql_num_rows($Result)) {
    //existing user
    //display specific user
    $user = $Row[1];
    $avatar = $Row[5];
    $likes = $Row[6];
    $posts = $Row[7];
    $signature = $Row[8];
    $about = $Row[9];
    $joined = $Row[10];
    $online = $Row[12];
    $status = $Row[13];
    $name = $Row[14];
    $gender = $Row[15];
    $location = $Row[16];
    $rank = $Row[17];
    }else{
    //nonexisting user
    //display error page
    
    }
    }
    ?>
    
    Then insert the variables into your html (aka echo them)

    For particular users using registration - you just insert data from forms to a temporary database table...

    then send out a confirmation email... on confirm - push data from temp table to the usable table

    ------

    For logins - use sessions ... at the top of each page check the session, and replace login/register in the nav with profile/logout

    ------

    to edit information, check if he/she is logged using sessions ...if they are - then allow them to access their information, else don't display the ability to edit.

    ------

    retrieving minecraft account information, just pull from their public api ... on registration check to see if the information exists on minecraft or mojang's records

    ------

    setting up avatars just have the upload redirect to a location you can use as a url in the avatar section of the database later on

    Code:
    <?php
    $target_dir = "images/";
    $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
    $uploadOk = 1;
    $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
    
    // Check if the image file is an actual image or fake image
    if(isset($_POST["submit"])) {
        $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
        if($check !== false) {
            echo "File is an image - " . $check["mime"] . ".";
            $uploadOk = 1;
        } else {
            echo "File is not an image.";
            $uploadOk = 0;
        }
    }
    
    // Check if file already exists
    if (file_exists($target_file)) {
        echo "Sorry, file already exists.";
        $uploadOk = 0;
    }
    
    // Check file size
    if ($_FILES["fileToUpload"]["size"] > 250000) {
        echo "Sorry, your image file size is too large.";
        $uploadOk = 0;
    }
    
    // Allowed file formats
    if($imageFileType != "jpg"
    && $imageFileType != "jpeg"
    && $imageFileType != "jpe"
    && $imageFileType != "jif"
    && $imageFileType != "jfi"
    && $imageFileType != "jfif"
    && $imageFileType != "png"
    && $imageFileType != "gif" ) {
        echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
        $uploadOk = 0;
    }
    // Check if $uploadOk is set to 0 by an error
    if ($uploadOk == 0) {
        echo "Sorry, your image was not uploaded.";
    // if everything is ok, try to upload the image
    } else {
        if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
            echo "Your image ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
        } else {
            echo "Sorry, there was an error uploading your image.";
        }
    }
    ?>
    
    have a file form option and a submit option redirect to that php page above (or just make it inline)

    ....that covers everything that xenforo has (other than css, which is pie)


    it is more finaccy to work with, but there's something called routing ...

    at the top of your index, you'd need to add a directory and routing definer:

    Code:
    <?php
    ob_start('ob_gzhandler');
    //{{{ defining constants
    define('DIR_WEB', dirname(__FILE__));
    define('DIR_MODUP', dirname(__FILE__).'/modup');
    define('DIR_SYS', DIR_MODUP.'/system');
    define('DIR_CTRL', DIR_MODUP.'/controller');
    define('DIR_TMPL', DIR_MODUP.'/template');
    define('DIR_VIEW', DIR_MODUP.'/view');
    
    //}}}
    //{{{ disecting the URI
    $ru = &$_SERVER['REQUEST_URI'];
    $qmp = strpos($ru, '?');
    list($path, $params) = $qmp === FALSE
        ? array($ru, NULL)
        : array(substr($ru, 0, $qmp), substr($ru, $qmp + 1));
    $parts = explode('/', $path);
    $i = 0;
    foreach ($parts as $part)
    {
        if (strlen($part) && $part !== '..' && $part !== '.')
        {
            define('URI_PART_'.$i++, $part);
        }
    }
    define('URI_PARAM', isset($params) ? '' : $params);
    define('URI_PARTS', $i);
    define('URI_PATH', $path);
    define('URI_REQUEST', $_SERVER['REQUEST_URI']);
    
    //}}}
    //{{{ routing and other init
    session_start();
    include DIR_SYS.'/router.php';
    include DIR_SYS.'/config.routes.php';
    
    if ($ctrl = Router::controller())
    {
        include $ctrl;
    }
    else
    {
        header('HTTP/1.1 404 Not Found');
    }
    //}}}
    ?>
    
    then inside of your modup, system, config.routes you'd need to add a custom router

    which in this case would be

    Code:
    Router::add('#/member/(:any)#',DIR_CTRL.'/members/index.php?=(:any)', Router::ROUTE_PCRE);
    
    or something similar...
    Gawadrolt likes this.
  14. I really think you're overlooking the complexity of premium software such as Xenforo... yes, it IS a lot of "do this, do that", but there's a reason they charge a very reasonable fee for it...
    607, sambish20, SkyDragonv8 and 2 others like this.
  15. Their websites still have a ton of flaws, and if it's "that" reasonable, then why are you limited in what you can do and edit?

    Learning php, mySqli, css, html5, xml, javascript ... they literally should take you less than a week to learn, if you can easily understand syntax.

    The only thing xenforo has going for it, is the pre-built templates for individuals to use... but you guys have been complaining about the limitations of xenforo for so long, yet defend it in counter-arguments ever since I've been a member here...

    Don't like it? Don't stay in the box; stray outside your comfort zone.

    That's why you keep backups of everything, so you can trial and error all your codes and designs.
    Gawadrolt and SkyDragonv8 like this.
  16. Learning a language in less than a week (and I mean learn, not "I can copy paste code in this language") is an absolutely ridiculous idea. Please tell me you're not being serious...

    Xenforo DOESN'T HAVE LIMITATIONS. EMC can literally go into Xenforo's code an edit it. The limitations are EMC's lack of development time to update Xenforo. The current version of EMC's site is perfectly usable.

    Edit: my bad for not mentioning this. Obviously "can" and "should" are different things. Practically, Xenforo (and most stuff) should be extended by plugins.

    Don't reinvent the wheel. Making people adapt to a completely different forum system is a terrible idea. There's a reason why practically every Minecraft server uses Xenforo or Enjin (and occasionally IP.Board).
    607, sambish20, markethan13 and 5 others like this.
  17. "Limitations" comes in the sense of you SHOULDN'T modify code from other people you depend on like XenForo and the Wiki Plugin.

    Modifying Xenforo is the exact reason we cant upgrade yet. We have to spend time to undo those hacks in order to upgrade.

    This is true for ANY piece of software. The only alternative is to fork it fully, and once you start modifying its code, you maintain it forever from that point and dont get to pull in changes the upstream author creates themselves...

    So the proper course is to do everything through plugins and API's but it depends on if the feature/change you desire is possible or not with API.

    As for our case, were just so out of date on many things that many issues are resolved by simply upgrading.

    One of these days (hopefully by the summer) I am aiming to take the time and do it.

    Writing code is easy. Maintaining code is the hard part.

    And yes our goal is to switch the wiki to WordPress. As part of my recent day job adventure, I've learned a TON of WordPress stuff and managing websites. I can give us some pretty nice tools to manage the content of the wiki inside of WP.
  18. and I can whip up some JavaScript hackery that will automatically do Jacks suggestion to get around it.

    Thanks for the tip jack, ill create a Track ticket and get to it soon.
    http://track.emc.gs/issue/SITE-48
    607, JackBiggin and AwesomeBuilder33 like this.
  19. The worst thing of all is trying to search for Pi Pie, to which you get the response that you well, can't search it. I believe Jack's hackery can get past this easily enough :) We can't do much else to change anything though, for all of the reasons mentioned about XenFero above in this thread... Hence the hoping to move the Wiki to WordPress eventually.
    607 likes this.
  20. good thing about JS things is it doesnt require me to modify core files, i can add a js import to a template and then target specific pages from there. that is easy enough to maintain.
    607 likes this.