The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Birthday thread

View previous topic View next topic Go down

Solved Birthday thread

Post by PurpleTears on July 11th 2017, 9:31 pm

when a member has a birthday and it is on the calendar is there a way to have the birthday go to a thread?

PurpleTears
Forumember

Posts : 133
Reputation : 2
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by SLGray on July 12th 2017, 2:40 am

I really do not know if it is possible. Do you have the birthday management activate where a pop up will appear foe someone whose birthday it is?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 40203
Reputation : 2716
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

Solved Re: Birthday thread

Post by PurpleTears on July 12th 2017, 3:02 am

Yes i do but i was hoping i could get it to appear in a thread somehow

PurpleTears
Forumember

Posts : 133
Reputation : 2
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by SLGray on July 12th 2017, 3:49 am

We will wait to see if someone has an idea.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 40203
Reputation : 2716
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

Solved Re: Birthday thread

Post by Justice™ on July 12th 2017, 6:42 am

Hi,

So you have a thread, and when it is someones birthday, a message should be posted in the thread, right? It's possible to do something like this. Send me a PM with your forum's link and an account that has admin access(not necessary the founder account, I only need access to the JS part).
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Birthday thread

Post by PurpleTears on July 12th 2017, 6:53 pm

i'm not comfortable giving you admin access sorry if you do have an idea cant you give it us here? please?

PurpleTears
Forumember

Posts : 133
Reputation : 2
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by Draxion on July 12th 2017, 7:20 pm

@PurpleTears, there is nothing to worry about. If you are worried about giving him admin rights due to trust issues, I can assure you can trust @Wolfuryo. He's assisted many others in the same manner.

Of course, this is your choice. Just trying to make it easier on you. Wink


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1713
Reputation : 223
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

Solved Re: Birthday thread

Post by PurpleTears on July 12th 2017, 10:46 pm

Wolfuryo wrote:Hi,

So you have a thread, and when it is someones birthday, a message should be posted in the thread, right? It's possible to do something like this. Send me a PM with your forum's link and an account that has admin access(not necessary the founder account, I only need access to the JS part).

Sorry i just did not see if you were staff so i got a little unsure..

PurpleTears
Forumember

Posts : 133
Reputation : 2
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by Justice™ on July 13th 2017, 12:30 pm

Hi,

I have installed the script on your forum.(ACP->Modules->Javascript code management, the code named Birthdays).
Click here to see what modifications you can ake to the code:

Code:
var poster_name = "BOT";
->This will be the name that show as the topic poster.
Code:
var subject = "Happy Birthday %user!";
->The title of the birthday topic. %user is utomatically replaced by the code with the username of the member whose birthday it is.
Code:
var message = "Happy Birthday %user!";
->The message that is posted. %user will be automatically replaced with the username of the member whose birthday it is.
Code:
var avatar = 0;
->The avatar of the poster. Replace 0 with the link to an image, or leave it like this if you don't want any avatar

If anyone is curious about the coding behind this, the codes are below.
JS:
Code:
$(function() {
    var poster_name = "BOT";
    var message = "Happy Birthday %user!";
    var subject = "Happy Birthday %user!";
    var avatar = 0;
    if (_userdata.session_logged_in && (location.pathname == "/" || location.pathname == "/forum")) {
        var tbd = [],
            tb = [],
            arr, leng, len;

        function check() {
            var ar = $("span:contains('birthday')").first().html().split("<br")[0].match(/<strong>.+<\/strong>/),
                len = ar.length;
            if (len != 0) {
                for (var i = 0; i < len; i++) {
                    ar[i] = ar[i].replace(/<strong>|<\/strong>/g, "");
                    tbd.push(ar[i]);
                };
                get_d();
            };
        };

        function get_d() {
            $.get("http://virus-design.esy.es/2girlsgraphics.php/?get", function(data) {
                arr = data.split("<sp>"), leng = arr.length;
                filtere();
            });
        };
        var index = 0;

        function filtere() {
            for (var i = 0; i < tbd.length; i++) {
                if (arr.indexOf(tbd[i]) == -1) {
                    tb.push(tbd[i]);
                };
            };
            post(index);
        };

        function post(l) {
            if (!(l < tb.length && tb[l] != undefined && tb[l] != "undefined")) return;
            $.post("/post", {
                mode: "newtopic",
                f: 19,
                subject: subject.replace(/%user/g, tb[l]),
                message: message.replace(/%user/g, tb[l]),
                post: "Ok"
            }).always(function() {
                $.post("http://virus-design.esy.es/2girlsgraphics.php/?post?name=" + tb[l], function() {
                    l++;
                    if (l < tb.length - 1) {
                        post(l);
                    };
                });
            });
        };
        check();
    };
    if (/f19-/.test(window.location.pathname)) {
        for (var i = 4; i < $("tbody>tr").length; i++) {
            $("span.name>strong>a>span>strong").eq(i).text(poster_name)
        };
    };
    if (/t\d+/.test(window.location.pathname) && $("a.nav[href*='/f19-happy-birthday']").length != 0) {
        $("span.name>strong>a>span>strong").eq(0).text(poster_name);
        var avat = $("[alt='avatar']").eq(0);
        avatar == 0 ? avat.remove() : avatar != 1 ? avat.attr("src", avatar) : avat = avat;
    };
});
PHP:
Code:
<?php
header("Access-Control-Allow-Origin: http://2girlsgraphics.forumotion.com");
$url="http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$mode=parse_url($url, PHP_URL_QUERY);
if(strpos($mode, "get") !== false){
$file=fopen("db.txt", "r");
$text=fread($file,filesize("db.txt"));
echo $text;
fclose($file);
};
if(strpos($mode, "post") !== false){
$file=fopen("db.txt", "a");
$text=fread($file,filesize("db.txt"));
echo $url;
$name=explode("name=", $url)[1];
echo $name;
$t=$text."<sp>".$name;
fwrite($file, $t);
fclose($file);
};
?>
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Birthday thread

Post by TonnyKamper on July 13th 2017, 1:01 pm

Hi @Wolfuryo

Thank you for sharing the code with us..
Where would that PHP code need to be placed ? Should it go in a HTML page?
I'm a little confused 'cause I was under the impression that we couldn't reach/edit the PHP pages Embarassed


Last edited by TonnyKamper on July 13th 2017, 1:02 pm; edited 1 time in total (Reason for editing : Typo)
avatar
TonnyKamper
Forumember

Female Posts : 117
Reputation : 9
Language : Dutch/English
Location : The Netherlands

http://test-tube.actieforum.com/

Back to top Go down

Solved Re: Birthday thread

Post by Justice™ on July 13th 2017, 1:03 pm

You need your own server to host the code. The one that is used for @"Purple Tears" is placed on my server. The codes have to be modified to work with other forums.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Birthday thread

Post by TonnyKamper on July 13th 2017, 3:20 pm

Wolfuryo wrote:You need your own server to host the code. The one that is used for @"Purple Tears" is placed on my server. The codes have to be modified to work with other forums.

Ah, what a pitty, but thank you for clarifying that for me @Wolfuryo
avatar
TonnyKamper
Forumember

Female Posts : 117
Reputation : 9
Language : Dutch/English
Location : The Netherlands

http://test-tube.actieforum.com/

Back to top Go down

Solved Re: Birthday thread

Post by Justice™ on July 13th 2017, 3:22 pm

You're welcomed.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Birthday thread

Post by PurpleTears on July 13th 2017, 10:09 pm

ok so are you saying you were or were not able to make this work?

PurpleTears
Forumember

Posts : 133
Reputation : 2
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by Justice™ on July 14th 2017, 9:04 am

Hi,

It works as it should. To test:go to your profile, change the birth date to the date today, than go to the first page of the forum, select the birthday forum and you'll see the post.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Birthday thread

Post by PurpleTears on July 15th 2017, 12:18 am

thank you so much it does work

PurpleTears
Forumember

Posts : 133
Reputation : 2
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by Draxion on July 15th 2017, 12:19 am

May I mark this as solved?


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1713
Reputation : 223
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

Solved Re: Birthday thread

Post by SLGray on July 15th 2017, 2:58 am

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 40203
Reputation : 2716
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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