The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Like button

3 posters

Go down

In progress Like button

Post by psaras February 4th 2015, 12:37 pm

Hello! I would like my forum to show members ID's after they click the like button.
I saw on an other post that you replied that Forumotion dosent have a database to save the names and this feature is not avalablie yet. Can you please tell me is there is a way to do this?
Thanks.
psaras
psaras
Forumember

Male Posts : 48
Reputation : 0
Language : bulgarian-Greek

http://gofishing.forumsclub.com/portal.htm

Back to top Go down

In progress Re: Like button

Post by Derri February 4th 2015, 12:44 pm

Its not possible on FM as you don't have access to the database servers. So unfortunately its not possible to do.
Derri
Derri
Helper
Helper

Male Posts : 8755
Reputation : 638
Language : English & Basic French
Location : Scotland, United Kingdom

Back to top Go down

In progress Re: Like button

Post by psaras February 6th 2015, 9:02 am

well, what needs to be done to make it possible. if you pay with credit?
psaras
psaras
Forumember

Male Posts : 48
Reputation : 0
Language : bulgarian-Greek

http://gofishing.forumsclub.com/portal.htm

Back to top Go down

In progress Re: Like button

Post by Ange Tuteur February 6th 2015, 9:19 am

Hi @psaras,

It's possible if you have your own database on an external server. If not that, it's also possible by using a topic as a database, but it requires having your forum open to a certain degree. I explain it in a beta test for phpbb3 here : http://fmdesign.forumotion.com/t273-
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Like button

Post by psaras February 6th 2015, 9:38 am

Ange Tuteur wrote:Hi @psaras,

It's possible if you have your own database on an external server. If not that, it's also possible by using a topic as a database, but it requires having your forum open to a certain degree. I explain it in a beta test for phpbb3 here : http://fmdesign.forumotion.com/t273-
This is great, but quite difficult for me.
However, thanks very much.
Could you help me?
psaras
psaras
Forumember

Male Posts : 48
Reputation : 0
Language : bulgarian-Greek

http://gofishing.forumsclub.com/portal.htm

Back to top Go down

In progress Re: Like button

Post by psaras February 6th 2015, 2:05 pm

Hello! I followed all your instructions to create a database and the like system step by step but in the end it dosent work properly... I can Like post but instead of showing the names of those who liked the post it keeps saying just "Loading...." and i dont know the reason.

Here is a photo of how the like system works on my forum

Like button 219chtv
 


And here is the database that i created. It's not the same like your example on your installation guide.
I think somewere there i am wrong with my steps but i think that i followed the instructions properply.

Like button 242beqd


It would be nice if you can help me. Smile
psaras
psaras
Forumember

Male Posts : 48
Reputation : 0
Language : bulgarian-Greek

http://gofishing.forumsclub.com/portal.htm

Back to top Go down

In progress Re: Like button

Post by Ange Tuteur February 6th 2015, 9:15 pm

Hi @psaras,

I apologize for the late reply. It's not working because I made a mistake in v1.01 of the database script, which causes an error in IE8<. I made the correction in 1.02 which I'm working on, but I forgot to apply the correction to the install topic.

Replace your fa_database script with :
Code:
_database = new Object();
_database.notice = 'Database plugin developed by Ange Tuteur - FM Design. Used to easily update and get topic database content.';
_database.tid = '/t7616-database';
_database.name = 'Database';

_database.data = function () {
  var db = document.createElement('DIV');
  db.style.display = 'none';
  return document.body.appendChild(db);
};

/* database get method */
_database.get = function(tid, code) {
  var db = _database.data();
  $(db).load(tid, function() { code(db, function() { document.body.removeChild(db) }) });
};

/* database post method */
_database.post = function(o) {
  if (_userdata.session_logged_in == 0) return;
  var db = _database.data(), tables;
 
  $(db).load('/post?p='+o.pid+'&mode=editpost #text_editor_textarea', function() {
    tables = $(this).find('textarea');
    if (RegExp('id="'+o.tableid+'"').test(tables.val())) tables.val(tables.val().replace(RegExp(o.update[0]), o.update[1]));
    else tables.val(tables.val().replace(/\[\/table\]/,o.newRow + '[/table]'));
    $.post('/post?p='+o.pid+'&mode=editpost', {
      subject: _database.name,
      message: tables.val(),
      post: 1
    }, function() { document.body.removeChild(db), o.reload && window.location.reload() });
  });
};

/* create a new database table */
_database.newTable = function() {
  var a = document.createElement('DIV'), b = document.createElement('INPUT'), c, t = document.createElement('TEXTAREA');
  a.className = 'db_overlay';
  b.className = 'db_button';
  t.className = 'db_textarea';
  b.value = 'Submit';
  b.type = 'button';
  c = b.cloneNode();
  c.value = 'Cancel';
  a.innerHTML = '<div class="dbo_content"><div class="db_title">Create a new database table</div><p class="db_info">Here you can create a new database table. For it to appear in the database, make sure to give the table the classname <strong>database_table</strong>, and a unique ID.</p><div style="text-align:center;"><p class="db_erreur"></p></div></div>';
  a.firstChild.insertBefore(t,a.firstChild.lastChild);
  a.firstChild.lastChild.appendChild(b);
  a.firstChild.lastChild.appendChild(c);
  document.body.appendChild(a);
 
  b.onclick = function() {
    if (!t.value.length) return this.previousSibling.innerHTML = 'You cannot create a new database table with an empty message body.';
    a.innerHTML = a.innerHTML + '<div class="db_overlay"><div class="dbo_content process">Processing request, please wait...</div></div>';
    $.post('/post', {
      subject : _database.name,
      t : _database.tid.match(/\/t(\d+)-/)[1],
      message : t.value,
      mode : 'reply',
      post : 1
    },function() { window.location.reload() });
  };
  c.onclick = function() { document.body.removeChild(a) };
};

/* START DATABASE CONTROL PANEL */
RegExp(_database.tid).test(window.location.pathname) && $(function() {
  var admin = '', type = _userdata.user_level;
  if (type == 1 && window.location.hash == '#edit') return $('.post').css('display','block');
  if (type == 1) admin = '<a href="#new" onclick="_database.newTable();return false;">New Table</a><a href="#edit" onclick="window.location.hash=\'#edit\';window.location.reload();">Edit Database</a>';
 
  document.title = 'Forum Database';
  $('body').append('<div id="theOverwrite"><div id="db_wrap"><h1>Forum Database</h1><p class="db_info">This database is for storing simple data for plugins. You should avoid storing personal data, and should consider making backups of your database tables whenever possible.</p><div class="db_nav">'+admin+'<a href="/forum">Return to index</a></div><div id="db_list"><div class="db_title">Database List</div></div><div id="db_tables"><div id="currentDB" class="db_title">Select a database table from the left</div><div id="innertable"></div></div><p style="color:#999;font-size:10px;text-align:right;margin:6px 0;">Developed by <a href="http://fmdesign.forumotion.com/u1" target="_blank">Ange Tuteur</a> | Version 1.01</p></div></div>');
  $('.database_table').appendTo('#innertable').hide().each(function() { $('#db_list').append('<div class="database">'+$(this).attr('id')+'</div>') });
  $('#page-footer, #pun-foot, #gfooter, #gfooter + p').appendTo('#db_wrap');
  $('body').addClass('databaseBody').html($('#theOverwrite').html());
  $('#db_list .database').on('click', function() {
    $('#db_tables .database_table').hide();
    $('#db_list .database').removeClass('dbactif');
    $(this).addClass('dbactif');
    $('#' + $(this).text()).show();
    $('#currentDB').text($(this).text());
  });
  $('#db_list .database:first').click();
});
/* END DATABASE CONTROL PANEL */

And it should correct the error. Smile
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Like button

Post by psaras February 7th 2015, 7:42 am

Thank you very much dear Ange.Like button 855598

Now everything is fine  Like button 187477

Just one more question!


How do I move the button right below the post, because it is now under the avatar and there will be no place for several nickname?
psaras
psaras
Forumember

Male Posts : 48
Reputation : 0
Language : bulgarian-Greek

http://gofishing.forumsclub.com/portal.htm

Back to top Go down

In progress Re: Like button

Post by psaras February 7th 2015, 10:05 am

Can I hide the forum "database" of index can not be seen by users?
psaras
psaras
Forumember

Male Posts : 48
Reputation : 0
Language : bulgarian-Greek

http://gofishing.forumsclub.com/portal.htm

Back to top Go down

In progress Re: Like button

Post by Ange Tuteur February 7th 2015, 10:33 pm

If you want the button to the right of the post, add this to your CSS :
Code:
.fa_like_row { text-align:right }

If you mean to redirect users from the database, try the following :

Create a new javascript with placement in all the pages with the code that follows.
( Modules > JavaScript codes management > Create a new script )

Only admins will be able to access it.
Code:
$(function() {
  var p = window.location.pathname;
  if (p.match(/t\d+/) && _userdata.user_level != 1) p.match(/t(\d+)/)[1] == _database.tid.match(/t(\d+)/)[1] && (window.location.pathname = '/')
});

You can also use CSS as an attempt to further hide the link of the topic :
( Display > Colors > CSS stylesheet )

However, this will also hide the link for you.
Code:
a[href^="/t7616"] { display:none }
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Like button

Post by psaras February 8th 2015, 12:30 pm

Like button 910598  thank you!
psaras
psaras
Forumember

Male Posts : 48
Reputation : 0
Language : bulgarian-Greek

http://gofishing.forumsclub.com/portal.htm

Back to top Go down

In progress Re: Like button

Post by Derri February 8th 2015, 1:23 pm

Is this topic now solved @psaras
Derri
Derri
Helper
Helper

Male Posts : 8755
Reputation : 638
Language : English & Basic French
Location : Scotland, United Kingdom

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum