1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Bookmark site

Discussion in 'Web Design & Development' started by russ1162, Jan 10, 2015.

Thread Status:
Not open for further replies.
Advertisement
  1. russ1162

    russ1162 Thread Starter

    Joined:
    Feb 11, 2002
    Messages:
    102
  2. colinsp

    colinsp

    Joined:
    Sep 5, 2007
    Messages:
    2,290
    First Name:
    Colin
    Do you have a script? Or do you want suggestions for one? Or what?
     
  3. russ1162

    russ1162 Thread Starter

    Joined:
    Feb 11, 2002
    Messages:
    102
    I would like suggestions on how to start one of my own. Just to bookmark my links online instead of computer or else where .
     
  4. colinsp

    colinsp

    Joined:
    Sep 5, 2007
    Messages:
    2,290
    First Name:
    Colin
    You need to give us a bit more information of exactly how you want to do this.

    Do you want to share bookmarks between different computer? Do you want a webpage you host yourself? Do you want a webpage on some sort of service that stores your bookmarks for you?

    Clearly define what you want to do and then maybe we can suggest something.
     
  5. russ1162

    russ1162 Thread Starter

    Joined:
    Feb 11, 2002
    Messages:
    102
    colin,

    I want to put this service on rn1162.com for just myself to use. If I would to publicly show the page I could then. Host my own bookmarks to keep track of my stuff.

    Thanks,
    Russ
     
  6. colinsp

    colinsp

    Joined:
    Sep 5, 2007
    Messages:
    2,290
    First Name:
    Colin
    Which browser do you use? That depends on the answer.

    If Firefox for instance you can select Bookmarks > Show All Bookmarks > Import and Backup > Export Bookmarks to HTML. This will create an html file that you can then upload to your site.

    Other browsers have similar export features but without knowing which you are using .....

    Firefox has a Sync setting which allows you to sync your bookmarks across multiple computers which I use rather than putting them up on the internet.
     
  7. russ1162

    russ1162 Thread Starter

    Joined:
    Feb 11, 2002
    Messages:
    102
    I would like to use multiple browsers, across multiple computers to do this. So that when i am on a public computer I can just drop by a page an add the link.

    Thanks,

    Russ
     
  8. colinsp

    colinsp

    Joined:
    Sep 5, 2007
    Messages:
    2,290
    First Name:
    Colin
    This is what I asked earlier to fully specify what you want.

    This will probably have to be a bespoke application with an input form for new sites, it will probably need a database as you will want to store the urls by group of similar type.

    I am not aware of anything that will do this. Try having a look at Hotscripts to see if there is something that will do this for you BUT fully specify what you want to do before you go looking so that you know if a pre-written script will do all that you want.
     
  9. russ1162

    russ1162 Thread Starter

    Joined:
    Feb 11, 2002
    Messages:
    102
  10. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,386
    First Name:
    Jim
    Are you looking for something like this - it may fit the bill.
     
  11. russ1162

    russ1162 Thread Starter

    Joined:
    Feb 11, 2002
    Messages:
    102
  12. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,386
    First Name:
    Jim
    I don't see why not. It seems completely self-contained - i.e. it doesn't appear to use OS dependent folders et cetera - it uses a python db.
    Were you looking for portability?
     
  13. russ1162

    russ1162 Thread Starter

    Joined:
    Feb 11, 2002
    Messages:
    102
    JiminSA,

    I am looking for portability too. Well i just think some of the one you could buy my work better but i do not know which ones.
    Plus there might be some good free ones that I do not know about.

    Thanks,

    russ
     
  14. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,386
    First Name:
    Jim
    Russ, I've had a good Google around and have not been able to find a script that really fits what you want to do.:(
    So, I had a little time on my hands and have written what I think you are looking for.
    It requires you to change your .html landing page (i.e. the page where you want to show your bookmarks) to a .php file and inserting some code into it as follows:-
    In the head section insert the following:-
    Code:
        <!-- Bootstrap core CSS -->
        <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
    
        <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
    
    This, because I've written it using bootstrap styling.
    Next we need to insert a side panel to display your bookmarks. So insert the following within your body section:-
    Code:
    <div class="container">
    	<div class="span2"> <!-- Sidebar content -->
    		<h3>Bookmarks</h3>
    <?php
    	$filename = 'bkm_data.txt';
    
    	if(file_exists($filename))
    	{
    		$data = unserialize(file_get_contents("bkm_data.txt")); // Unserializes the file's contents, thereby turning itself into an array. 
    		if (!empty($data))
    		{
    			foreach($data as $key => $val) 
    			{ // Iterates through the array 
    				echo '<button type="button" class="btn btn-link"><a href="'.$val.'" target="_blank">'.$key.'</button><br />'; // Writes an href button for each key. 
    			} 
    		}
    	}
    ?>				
    	</div> <!-- END Sidebar content -->
    </div>
    
    Right, now for the bookmark creation program itself ...
    Copy and paste the following into a Notepad++ page (or whatever editor you use) and save it as a .php file in the same folder as your landing page (in which we just inserted the above code) which you'll remember (I called mine 'booker.php')
    Code:
    <?php
    	session_start();
    	$array = array(); 
    
    	if(isset($_POST['Name']) && $_POST['Name'] != "")
    	{
    		$name = htmlspecialchars($_POST['Name'], ENT_QUOTES);
    		$url = htmlspecialchars($_POST['URL'], ENT_QUOTES);
    		
    		$filename = 'bkm_data.txt';
    		if(file_exists($filename))
    		{
    			$array = unserialize(file_get_contents("bkm_data.txt")); // Unserializes the file's contents, thereby turning itself into an array. 
    		}
    		
    		$array[$name] = $url;
    		ksort($array);
    		$res = fopen("bkm_data.txt","r+"); // Opens a resource 
    		$string = serialize($array); // Sets a variable to identify the serialized array 
    		$write = fwrite($res,$string); // Writes it to the file 
    		@fclose($res); 
    	}
    	//unset($array[$name]);
    ?>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="CMS to create Bookmarks">
        <meta name="author" content="Jim Ord">
        <link rel="icon" href="favicon.ico">
    
        <title>Bookmarker</title>
    
        <!-- Bootstrap core CSS -->
        <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
    
        <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    
    <body>
    	<div class="container">
    		<div class="row">
    			<div class="span12"> <!-- form content -->
    				<h3>Add a Bookmark</h3>
    				<form name="Bookmark" action="" method="post">
    					<label>Bookmark Name <input type="text" id="Bookmark" name="Name" required="required" /></label>
    					<label>Bookmark URL <input type="text" id="Bookmark" name="URL" placeholder="http://" required="required" /></label>
    					<button type="submit" class="btn btn-default">Submit</button>
    				</form>
    			</div> <!-- END form content -->
    			<div class="span2"> <!-- Sidebar content -->
    				<h3>Bookmarks</h3>
    <?php
    	$filename = 'bkm_data.txt';
    
    	if(file_exists($filename))
    	{
    		$data = unserialize(file_get_contents("bkm_data.txt")); // Unserializes the file's contents, thereby turning itself into an array. 
    		if (!empty($data))
    		{
    			foreach($data as $key => $val) 
    			{ // Iterates through the array 
    				echo '<button type="button" class="btn btn-link"><a href="'.$val.'" target="_blank">'.$key.'</button><br />'; // Writes an href button for each key. 
    			} 
    		}
    	}
    ?>				
    			</div> <!-- END Sidebar content -->
    		</div>
    	</div>
    </body>
    </html>
    Finally, you need to create an empty .txt file - called bkm_data.txt (you can use MSNotepad or whatever to do this) and save it in the same folder as your landing page.
    OK, upload that lot to your server, and then create a url to the above program (e.g. http://yoursite.com/booker.php) and start creating your bookmarks - enjoy;)
    FYI...
    I have not used a database per se, to hold your bookmarks (it's such a small load), but as you've probably seen, I am using a .txt file which I serialize and unserialize accordingly. It's a handy alternative to a db IMHO;)
    Take a peek at the attachment to see how it looks ...
     

    Attached Files:

    • BKM.png
      BKM.png
      File size:
      17.2 KB
      Views:
      31
  15. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,386
    First Name:
    Jim
    See it in action here. Would you like a delete function?
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1140957

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice