FM Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

IMPORTANT

FM Design is in read-only mode, please click here for more information.

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49

» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21

» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28

» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15

» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11

» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24

» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58

» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50

» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22

» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12

» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10

» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51

» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11

» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19

» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34

Recent Tutorials
Top posting users this month

Who is online?
In total there are 12 users online :: 0 Registered, 0 Hidden and 12 Guests :: 2 Bots

None

[ View the whole list ]


Most users ever online was 515 on Tue 14 Sep 2021, 15:24

[SOLVED] About an Advertisement Bot

View previous topic View next topic Go down

Anonymous
Guest
Guest

PostGuest Wed 04 May 2016, 12:44

Hello. I just found out this Javascript on a site. I know that I should have asked this on the website where I got this, but it won't allow me to post external links for a period of time (a new member there). So for the problem, I cannot rename the Advertisement Bot's name even if (I know) I edit it in
Code:
member: 'AdMonster',//Define Name of a Bot
. If I do so, it just gives me the undefined name.

This is the code (Please don't mind the texts I added there. I was just testing that out):

Code:
$(function() {
var p = {
post: $('.post')[0],
author: $('.author:first').html(),
date: $('.topic-title').first().html(),
announce: 'What does the fox say?<br>Is this a space?<br><br>Is this a double space?<br><strong>Is this bold?</strong>',//Enter the code beside the advertising
member: 'AdMonster',//Define Name of a Bot
imagem: 'http://i.imgur.com/tdaNexK.jpg',//Picture of the Bot
message: '0',//Total Number of Post
register: 'Always',//Date Registred
location: 'Front Desk'//Location
};
$(p.post).after('
<div class="post row1 online" style="margin:10px 0px 10px 0px">
<span class=corners-top><span></span></span>
<div class=postbody>
 <h2 class="topic-title">'+p.date+'</h2>
<p class="author">'+p.author+'</p>
  <div class=content>'+p.announce+'</div>
</div>
<div class=postprofile>
<dl><dt><img src='+p.imagem+'><br><b style=font-size:1.2em>'+p.membro+'</b></dt><br><dd>
<span class="label">Messages: </span>'+p.message+'<br>
<span class="label">Date Registered: </span>'+p.register+'<br>
<span class="label">Location: </span>'+p.location+'<br>
</dd>
</dl>
</div>
<span class=corners-bottom><span></span></span></div>
');
});

Is there something lacking there? (Tagging @Ange Tuteur)
Van-Helsing
Van-Helsing

Gender : Male
Age : 49
Posts : 853
Points : 4842
Reputation : 84
Location : Somewhere out there!
Language : English, Greek
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : punBB
http://itexperts.forumgreek.com/

PostVan-Helsing Wed 04 May 2016, 17:02

Hello @Poser,
As I checked your code I found some classes names without quotes ("")
Try this code:

Code:

        $(function() {
        var p = {
        post: $('.post')[0],
        author: $('.author:first').html(),
        date: $('.topic-title').first().html(),
        announce: 'What does the fox say?<br>Is this a space?<br><br>Is this a double space?<br><strong>Is this bold?</strong>',//Enter the code beside the advertising
        member: 'AdMonster',//Define Name of a Bot
        imagem: 'http://i.imgur.com/tdaNexK.jpg',//Picture of the Bot
        message: '0',//Total Number of Post
        register: 'Always',//Date Registred
        location: 'Front Desk'//Location
        };
        $(p.post).after('
        <div class="post row1 online" style="margin:10px 0px 10px 0px">
        <span class="corners-top"><span></span></span>
        <div class="postbody">
        <h2 class="topic-title">'+p.date+'</h2>
        <p class="author">'+p.author+'</p>
          <div class="content">'+p.announce+'</div>
        </div>
        <div class="postprofile">
        <dl><dt><img src='+p.imagem+'><br><b style=font-size:1.2em>'+p.membro+'</b></dt><br><dd>
        <span class="label">Messages: </span>'+p.message+'<br>
        <span class="label">Date Registered: </span>'+p.register+'<br>
        <span class="label">Location: </span>'+p.location+'<br>
        </dd>
        </dl>
        </div>
        <span class="corners-bottom"><span></span></span></div>
        ');
        });
Anonymous
Guest
Guest

PostGuest Wed 04 May 2016, 18:28

The name is still undefined.
I wonder why.
Wolfuryo
Wolfuryo

Gender : Male
Posts : 256
Points : 3606
Reputation : 81
Language : Romanian and English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other

PostWolfuryo Thu 05 May 2016, 00:25

Hello,

Try:
Code:
$(function() {
var p = {
post: $('.post')[0],
author: $('.author:first').html(),
date: $('.topic-title').first().html(),
announce: 'What does the fox say?<br>Is this a space?<br><br>Is this a double space?<br><strong>Is this bold?</strong>',//Enter the code beside the advertising
member: 'AdMonster',//Define Name of a Bot
imagem: 'http://i.imgur.com/tdaNexK.jpg',//Picture of the Bot
message: '0',//Total Number of Post
register: 'Always',//Date Registred
location: 'Front Desk'//Location
};
$(p.post).after('<div class="post row1 online" style="margin:10px 0px 10px 0px"><span class="corners-top"><span></span></span><div class="postbody"><h2 class="topic-title">'+p.date+'</h2><p class="author">'+p.author+'</p>  <div class="content">'+p.announce+'</div></div><div class="postprofile"><dl><dt><img src='+p.imagem+'><br><b style="font-size:1.2em">'+p.member+'</b></dt><br><dd><span class="label">Messages: </span>'+p.message+'<br><span class="label">Date Registered: </span>'+p.register+'<br><span class="label">Location: </span>'+p.location+'<br></dd></dl></div><span class="corners-bottom"><span></span></span></div>');
});
Anonymous
Guest
Guest

PostGuest Thu 05 May 2016, 00:59

Well, that worked! Thanks! If you don't mind, what made the previous code not working?
Wolfuryo
Wolfuryo

Gender : Male
Posts : 256
Points : 3606
Reputation : 81
Language : Romanian and English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other

PostWolfuryo Thu 05 May 2016, 03:55

Hello,

'+p.membro+'
The variable membro is not defined. I simply changed membro to member(defined in the p object) and added the quotes @Van-Helsing mentioned.
Sponsored content

PostSponsored content

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

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