themac

themac does not currently provide support for this item.

51 comments found.

Hello! With echo $sbm->showform(); the page goes blank, but with the a href the script works perfect… any ideas? I’m using codeigniter and COOKIE session to bookmark. Thanks.

hi,

ist the class included and initiated on the site where you’re calling showform() ?

are there any etries in the error_log

rgds
amc

Sure, I calling like <?php include("my-path/sbm.class.php"); $sbm = new SimpleBM("COOKIE",1); ?>

I just have this entry in the error_log:

PHP Parse error: syntax error, unexpected $end

hmmm…

don’t think the parser error is from the class file – could you send me the non working file via email (I’ve contacted you right now via your profile page)

rgds
mac

Hi,

i have the following issue,

i have created a separate db for simpleBookmarks, i have connected to sql through sbm.class.php but is not writing the userid.

After i bookmark a page, the uid row is always (0), i checked everything and with echo i can get my users id and auth.

I am using the following code in my php page where i want to appear the bookmark button:

<?php $uid = $this->Auth->user('id');?>
<?php $auth = $this->Html->isAllowed($this->Auth->user('user_type_id'));?>
<?php 
include("/var/www/vhosts/mydomain/httpdocs/app/webroot/sbm/sbm.class.php");
$sbm = new SimpleBM($uid,$auth,$db);
?>
<script src="//mydomain/js/libs/1.9.0-jquery.min.js"></script>
<script type="text/javascript" src="//mydomain/sbm/sbm.min.js" id="sbmjs"></script>
<?php echo $sbm->showform("Simple Bookmark System"); ?>

it’s all the same, you have to deliver your $uid and $auth values if you don’t want to use the IP-Address for identification

but you could first try to make it work by removing

<script type="text/javascript" src="//mydomain/sbm/sbm.min.js" id="sbmjs"></script>
and if it’s work you can go on with the ajax version

btw. you can find out if ajax is used when there’s no page loading when bookmarking

and: it’s a bit strange that a zero is stored,hmmmm?

i have remov it and is now is not sending anything to sql

<?php 
include("/var/www/vhosts/mydomain/httpdocs/app/webroot/sbm/sbm.class.php");
$uid = $this->Auth->user('id');
$auth = $this->Html->isAllowed($this->Auth->user('user_type_id'));
echo "<hr />UID: $uid<br />AUTH: $auth<hr />";
$sbm = new SimpleBM($uid,$auth);
?>
<script src="//mydomain/js/libs/1.9.0-jquery.min.js"></script>
<?php echo $sbm->showlink(); ?>

could you send me the link to your installation?

cookies demo please?

thank you. I will buy soon.

Hi i can use php can its works only via javascript or jquery? thanks

hi,

bookmarks will be saved/displayed only with the help of PHP

jquery/javascript just used for the dynamic behaviour

rgds
mac

Can we make an ouput of bookmarks in a string PLAIN text. Like POSTNAME, POSTNAME, POSTNAME etc..

Thx.

hi,

if you take alook to the demo you’ll see an array output when clicking on “Your Bookmarks” (if you have any) – so you can do anything you wnat with this information, including a plain/text output

hope I could help
mac

Hi, this is not working for me on my website.

My information:

- sbm.class.php:

//DB Settings - only necessary if you're don't provide an existing DB-connection var $db_host = "localhost"; //change if needed!! var $db_user = "alexda"; //change if needed!! var $db_pass = "9c5g5DgCFe"; //change if needed!! var $db_name = "woobasic"; //change if needed!! //Your bookmarks table var $bm_table = "users"; //change!! //Link to bookmarks page var $bm_link = "./bookmarks.php";

- index.php:

<?php $userid = (isset($row['id']) ? $row['id'] : ""); include("sbm/sbm.class.php"); $sbm = new SimpleBM($userid,1); ?>

I have created a database, where a row called “id”. All users in my database have an “id”. When I enter my website, I only see the following message:

Please authenticate to bookmark

What am I doing wrong? Can you help me, please?

hi,

AGAIN: SBM has no and is not an user management system, so there’s no configuration which can be provided.

if you call

$sbm = new SimpleBM($userid,1);
YOU have to make sure to get the $userid of YOUR authenticated user

another hint,you shouldn’t use

$userid = isset($row['user_id']) ? $row['user_id'] : 1;
in combination with your preset authentication value (1) – because, if someone isn’t really authenticated into your website you “tell” SBM that the user has the id 1 and is authenticated regardless.

usually userids and boolean for authentication and other information would be saved into session/cookie keys after login succeeded, and everytime you need the information of the logged in user you could revert to these values.

if you are using the AJAX methods:

If you have any special authentication or database settings please add them to the sbm.ajax.php too.

I suggest to make it run without AJAX, and if it works update tha ajax – php file

and for your tests: just try an

echo $userid;
before initiating the SBM class, so you would see the value used by SBM

rgds
mac

Is it possible to list all the bookmarks of a particular user?

hi,

there’s no overall admin interface (and no users) – each “user” can view his own Bookmarks
but needed informations are stored in the table, so you build your own querries and list entries of each “user” by grouping results by “uid” or “crit” – depending on your settings

best wishes
mac

Hello,

I was wondering how this plugin stores everything in the database. Is it safe to use it on a huge and extremely trafficked site, or will it slow down performance by using a lot of heavy MySQL queries for each page request etc.? Thanks in advance.

there would be just one simple mysql select query when calling a page where SCB is being used – so I don’t think that SCB would be a reason for a performance bottleneck

Thanks for the quick reply! What I would really need to know however is how and where the data is being stored. Is it as an array in the options table or in columns for each post or in any other way? Thanks.

just the url, the criterium and the title (next to some useful info) is stored for each Bookmark – maybe this helps: http://i.share.pho.to/38c2112b_o.png

just purchased and have everything set up, but am getting a “call to member function showform() on null” error (http://cl.ly/image/2T0H2I3k301q/Screen%20Shot%202015-05-19%20at%207.01.40%20PM.png).

Any ideas what may be causing the issue?

hi,

instead of using just

new SimpleBM($uid, $auth, $db);
use
$sbm = new SimpleBM($uid, $auth, $db);

hope this helps
mac

worked like a charm! thank you!

you’re welcome :)

Just wanted to say that script is great!

thx :)

Hello. I have some problems with the settings of the sbm.class.php. i need only the ”$sbm = new SimpleBM(“COOKIE”,1);”. But where must i set this? There al lot of syntax with database ans so on. i didnt need them. i need a cleare sbm.class.php with the settings for cookies without any database, ip, id … please help me. thank you.

hi,

Cookie, IP-Address, Email-Adress or any other string can be used to identify your users
the bookmarks itself will be saved into the database – so a mysql database is needed – COOKIE is only one way to identify the logged-in user (added with V2.5)

ein Frohes Fest wünsche ich noch
mac

IP address seems to be the only thing that is working.

Works: <?php include($_SERVER[‘DOCUMENT_ROOT’].’/dir/sbm.class.php’); $sbm = new SimpleBM($_SERVER[“REMOTE_ADDR”],1); ?>

Does not work: <?php include($_SERVER[‘DOCUMENT_ROOT’].’/dir/sbm.class.php’); $sbm = new SimpleBM(“COOKIE”,1); ?>

Trying to use the cookie puts info in DB just like IP but will not output info via <?php echo $sbm->bookmarks(); ?>

Nothing else is changed. Is there something else that needs adjusted in the class file? IP isn’t an option for me.

hi,

the only thing that there are no characters allowed before calling the class is the COOKIE issue
cite from php.net

Like other headers, cookies must be sent before any output from your script (this is a protocol restriction). This requires that you place calls to this function prior to any output, including  and <head> tags as well as any whitespace.
that’s why I mentioned this in an Attention part in the manual
spaces and anything can be preused when using the Remote Address

I think the best to solve this issue quickly and without timzone conflicts (if there are any) is toi send me the URL to your current installation and if wished temporary FTP credentials to get it working through my profile page

rgds
mac

Where should the SBMKey for the cookie be placed in the database? I have ‘uid’, ‘crit’, ‘title’, ‘url’, ‘created’.

uid is blank. crit has an IP. everything else is as expected. Should there be another field?

Cookie: Name: SBMKey Content: 837e38ec0ab2e0b1484ebeabdb525e7a

Should crit match the cookie content instead of an IP?

I’ve uploaded the files again from the downloaded zip folder. No alterations made except db connection, table, and link to bm page in the class file to function.

hi,

the SBMKey should be stored in the crit field of your database – if you are using “COOKIE” when storing the url then there should be an md5hash, like the key you posted.

if you are using ajax/jquery to store the URL you have to set “COOKIE” as authentication mode too.

as I see it’s not a case of showing the bookmarks but of storing, ajax and wherever you have used the showForm() method has to use the “COOKIE” mode AND including and initializing of the class should be done before any character

the simplest and working example of the COOKIE usage:

create a file called bla.php with this really just this content
<?php
include("bm/sbm.class.php");
$sbm = new SimpleBM("COOKIE",1);
echo $sbm->showForm();
?>

let me know if you need some helping hands, my previous offer still holds.

rgds
mac

by
by
by
by
by
by