HH Editor - Web Editor

Status
Not open for further replies.

hamking

Member
Dec 14, 2013
42
6
hello.
i'm up to doing something new and i thought about a web editor.
this will be free.
So if you do not know what a web editor is, check webs.com.

I've just started coding again after a couple of weeks ago and i took the time to learn myself ajax, more javascript, more jquery and more php. So hopefully everything will be OK when this project is finished.

here's some snippets.

"Global" class
PHP:
class Globala{

        public function __construct($files){

            if(is_array($files)){
                foreach($files as $file => $value){
                    if($this->fileExists($value)){

                        try{
                            // Försöker inkludera varje fil..
                            $this->incFile($value);
                           
                        }catch(Exception $error){

                            die($error->getMessage());
                       
                        }

                    }else{
                        echo 'Ngt fel i global.class.php, err 1';
                    }
   
                }

            }else{
                echo 'fel 2';
            }
           
        }

        public function fileExists($file){
            return file_exists($file . '/');
            return $this;
        }

        public function incFile($files){

            foreach(glob($files . '/*.php') as $file){
                include $file;
            }
           
            return $this;
        }


       



    }

user class:
PHP:
        public function __construct($db){
            $this->_db = $db;
            $_SESSION['userid'] = $this->randomizeToken();
            $this->setToken();
            Core::set(@$_SESSION['userid']) ? $this->_userid = $_SESSION['userid'] : true;
        }
       
        public function setToken(){
            $this->_usertoken = $_SESSION['usertoken'];
        }
       
        public function randomizeToken(){
            return base64_decode(openssl_random_pseudo_bytes(32));

        }


        public function getUserInfo($column){
            $this->_db->pquery("SELECT * FROM users WHERE id=?")->pbind('i', array($this->_userid))->prun();
            $got = $this->_db->pget();
            $gotten = $got->fetch_assoc();
            return $gotten[$column];

        }

core class
PHP:
public function __construct(){
            // EMPTY ATM
           
        }

        public static function isEmpty($value, $m){
            return empty($value) ? die($m) : true;
        }

        public static function set($value){
            return isset($value);
        }

        public function inPage($page){
            return $_SERVER['SCRIPT_NAME'] == $page;
        }

        public function only($session){

            switch($session){
                case true:
                    return true;
                break;
                case false:
                    header("Location:index.php?page=index");
                    return false;
                    break;

                default:
                    return false;
                    break;   

            }

        }

        public function offlinePage($session){
            switch($session){
                case true:
                    header("Location:index.php?page=home");
                    break;
                case false:
                    return true;
                    break;
                default:
                    return false;       


            }
        }

        public function page($page){
            return $_GET['page'] == $page;
        }
       
        public function createFile($path, $format){
            $l = 'abcdefghijklmnopqrstuvwxyz0123456789_';
            $new = str_shuffle($l);
            return fopen($path . $new . $format, 'w');
        }
       
        public function deleteFile($link){
            return unlink($link);
        }

im not done coding any of these files yet, i still have a bunch of stuff left.
there's probably bugs in the code, i'll fix that later.

print screens:
- frontpage

and that's everything i got atm.
i'll be updating every week probably, still have a lot of school.

bye. (sorry for my bad english)
 

Jxck

got that old thing back
Apr 5, 2014
135
34
Sounds like an interesting project, simple design so far. Good luck with it!
 

Khalil

IDK
Dec 6, 2011
1,642
786
It is best to kill the page after a redirect like so:
PHP:
header("Location: /home"); die; // or exit;
 

hamking

Member
Dec 14, 2013
42
6
I came up with this idea;
you'll be able to create account and so on, and create your own shit without coding. when you're finished, you can share it on the website, which you gain points for. Everyone will be able to preview the site you've done, and then dislike or like it, and comment and so on.
i'm gonna fix achievements too just for fun lol.

so what do you guys think about this idea?

EDIT: They'll be able to download it too.
 

Doge

Active Member
Jan 12, 2012
174
40
Not sure about the idea, I'd just make it like Webs.com or something. You can add different features but I wouldn't really have points for creating websites.
 

Zaka

Programmer
Feb 9, 2012
471
121
Sounds like an interesting project. Although I would only do this for educational purposes since we already have great websites that provides us with a web editor such as wix.com or webs.com

And they are really good, so I would just do this for a educational purpose. About your idea with liking, unliking and getting achievments for a webpage just makes the whole idea twisted. Then it would be more like a sort of game where you design websites through your editor, gaining achievments?

However, goodluck with this, I'll be following the progress.
 

hamking

Member
Dec 14, 2013
42
6
Sounds like an interesting project. Although I would only do this for educational purposes since we already have great websites that provides us with a web editor such as wix.com or webs.com

And they are really good, so I would just do this for a educational purpose. About your idea with liking, unliking and getting achievments for a webpage just makes the whole idea twisted. Then it would be more like a sort of game where you design websites through your editor, gaining achievments?

However, goodluck with this, I'll be following the progress.

yes, i'm not planing to launch a super project or anything like that, i want to use the stuff i've learned.
About that idea, I just thought about making it a bit like a social network. but nah, i don't think i'll add liking unliking and so on.

Seems a bit interesting.. good luck on your project
thanks!

EDIT:
Tomorrow, i'll start coding stuff like "Add Text" and "Add Box". I'll make some random themes, which you can chooce between, you do not need to have any theme. you can do your website from scratch.
also fixing some bugs and cleaning codes, adding a lot of codes.

I'll be updating every day till next week.
This development will be slow, so i'll be finished in like 2-3 months (could take longer)!
 
Last edited:

Sysode

Front-End Developer
Dec 11, 2012
1,673
848
Hate to rain on your parade but these types of sites are fucking bullocks. Web designers exist for a reason. Sites like webs and whatever the other shitty ones are, misguide people into using them because they are "cheaper".. The reason they come across this way is because they all feature the same shitty templates (no originality or creativity), have next to non or just plain awful SEO and worst of all are coded horribly most of the time.

Anyway, if this is just for educational purposes, best of luck and hope all goes well :)
 
Status
Not open for further replies.

Users who are viewing this thread

Top