lookjapan.COM - IRC ve mIRC dünyasının forumu!

lookjapan.COM - IRC ve mIRC dünyasının forumu! (http://www.lookjapan.com/index.php)
-   IRCServices Hazır Kodlar (http://www.lookjapan.com/forumdisplay.php?f=180)
-   -   Topic Yazım Tarihi. (http://www.lookjapan.com/showthread.php?t=2291)

Code 23 Eylül 2015 16:38

Topic Yazım Tarihi.
 
Kanal infosunda en son topic atan tarihi gün,saat,dakkika,saniye biçiminden editi .

Kod:

cd ircservices-5.0.5*
cd modules/chanserv
pico main.c

main.c dosyası içerisinde aşağıdaki saıtırları buluyoruz ;

Kod:

static void do_info(User *u)
{
    char *chan = strtok(NULL, " ");
    char *param = strtok(NULL, " ");
    ChannelInfo *ci;
    NickGroupInfo *ngi, *ngi2 = NULL;
    char buf[BUFSIZE], *end, *s;
    int is_servadmin = is_services_admin(u);
    int can_show_all = 0, show_all = 0, used_all = 0;

Hemen altına ;

Kod:

    char buf3[BUFSIZE];
    time_t simdi = time(NULL);

Satırlarını ekliyoruz yine aynı dosya içerisinde ;

Kod:

                notice_lang(s_ChanServ, u, CHAN_INFO_LAST_TOPIC,
                            ci->last_topic);
                notice_lang(s_ChanServ, u, CHAN_INFO_TOPIC_SET_BY,
                            ci->last_topic_setter);

Yukarıdaki satırları bulup hemen altına ;


Kod:

                if (ci && ci->last_topic) {
                        free_time(buf3,(time(NULL))-(ci->last_topic_time),u);
                        send_cmd(s_ChanServ, "NOTICE %s :  Yazilim tarihi: %s [%s]", u->nick, buf, buf3);
                }

Ekliyoruz dosyadan kayıt edip çıkıyoruz .


Kod:

cd ../..
pico extern.h

exren.h doyası içerisinde aşağıdaki satırı buluyoruz ;

Kod:

E int lock_data(void);
Bu satırların hemen üstüne aşağıdaki kodu ekleyiyoruz ;


Kod:

E void free_time(char *buf, time_t t, User *u);
Dosyadan kayıt edip çıkıyoruz.Aşağıdaki komutla devam ediyoruz ;


Kod:

pico misc.c
misc.c dosyası içerisinde aşağıdaki satırları buluyoruz ;

Kod:

    if (outpos < outsize)
        outp[outpos] = (i2&3)<<6 | i3;
    outpos++;
    }
 
    return outpos;
}

Bu kodların hemen altına aşağıdaki kodu ekliyoruz ;


Kod:

void free_time(char *buf, time_t t, User *u)
{
  int days, hours, minutes, seconds;
  days = t / (24 * 3600);
  t %= 24 * 3600;
  hours = t / 3600;
  t %= 3600;
  minutes = t / 60;
  t %= 60;
  seconds = t;
  sprintf (buf, "\2%d\2 gün, \2%d\2 saat, \2%d\2 dakika ve \2%d\2 saniye önce", days, hours, minutes, seconds);
}

Dosyayı kayıt edip çıkıyoruz ;


Kod:

make
make install

Servisleri restartlıyoruz.
Kod yazarı: Netdelisi..


All times are GMT +3. The time now is 10:47.

Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.