Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[DEV] Link saver & Publisher

Newbie Spellweaver
Joined
Feb 16, 2016
Messages
5
Reaction score
1
Hello,
I am here today to show off my project that is my learning site for PHP and MySQL(Maybe some JS later on?). I've been working on this for 2 weeks, and started to learn PHP and MySQL 1.5 months ago and saw this as the best way to learn.​

So, what it is? Well, it's not the best idea. But this is a way to save any links on the web and access it very easy by giving it a title and sort it in orders. What I mean with that is the first link you upload will be the last one after adding some more, and the newer one will always be on top.

Well, this is good. But there's alot of sites like this, so what I wanted to do is create a user system so I can search for users or friends and see their profile and links and heart them wich I think is a good idea.

So back to your account, when you upload the link your link so go on the "Flow" of the site, and the wall is place where ALL links that is being published will go. Just like a facebook wall but for links.

So what steps has been done?

  • Create an account and login (100%)
  • Post links to your profile and flow(85%)
  • See registered users (100%)
  • Admin panel (10%) - It works good, but more admin power to come!
What to come?

  • Heart/Favourite other users links
  • Follow other users
  • Search for users
  • Publish or not publish to the public Flow
  • Profile editing(Profile picture, bio, sex, country, etc)
This will be a good mix of keeping stuff at one place for those who uses links alot and a way to keep in touch with other people.
Notice that this is NOT the final design, it's just a template for me to keep stuff clean.

Code snippets(Not the best, Im not so familiar with this yet)

PHP:
if(isset($_POST['btn-update'])) {
    $updateMyPost = mysqli_real_escape_string($con, $_POST['updateMyPost']);
    $user_id = mysqli_real_escape_string($con, $_POST['user_id']);
    $prefix = mysqli_real_escape_string($con, $_POST['prefix']);

    if(mysqli_query($con, "INSERT INTO posts(link, user_id, prefix) VALUES('$updateMyPost', '$user_id', '$prefix')")) {

    } else {
        echo 'fail!';
    }
}

PHP:
if(isset($_SESSION['user'])) {

$sql = "SELECT * FROM posts WHERE user_id=".$_SESSION['user'];
$result = $con->query($sql);

if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
        ?> <span style="float:right"> Your ID: <?php echo $row['user_id']; ?></span> <?php
        ?> <span style="float:left"><a href="<?php echo $row['link']; ?>" target="_blank"><?php echo $row['prefix']; ?></span></p></a><br><br> <?php
    }
        } else {
       ?> <center> <?php echo "Update your first link!"; ?> </center> <?php
        }
    }
}

fbd2aa6c61a4468798c6311fe17e757f - [DEV] Link saver & Publisher - RaGEZONE Forums
d8d07190762afa8ddf1a6ab71dc46f78 - [DEV] Link saver & Publisher - RaGEZONE Forums
af79e47704c956c4426c372a74de6a0b - [DEV] Link saver & Publisher - RaGEZONE Forums
39aac72dd43cc85385435cfa834d9e2c - [DEV] Link saver & Publisher - RaGEZONE Forums

- Best regards.
 

Attachments

You must be registered for see attachments list
Last edited:
Back
Top