xoops forums

Forum Index


Board index » All Posts (KubaZ)




KubaZ

Just popping in
Posted on: 2007/3/12 11:40
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#1

Re: Email protection hack in userinfo.php

Hi,

today I got a message that link is dead.
Apparently I deleted this because I didnt use XOOPS for a long time.
I will try to repair link, and post a message on forum.

Edit: link works

Cheers
KubaZ


KubaZ

Just popping in
Posted on: 2005/6/12 22:51
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#2

Re: Need a little hack for mylinks

Hi , I think that you have to inform your script you use random sorting :

$rand = isset($HTTP_GET_VARS['rand']) ? intval($HTTP_GET_VARS['rand']) : 1;


if ( (isset(
$HTTP_GET_VARS['orderby'])) && ($rand == 0)) {
$orderby convertorderbyin($HTTP_GET_VARS['orderby']);
} else {
$orderby "rand()";
}


and then you have to modify several links by adding variable rand to the url, e.g. ( add &rand=$rand )
$page_nav .= "<a href='viewcat.php?cid=$cid&amp;min=$prev&amp;orderby=$orderby&amp;show=$show&amp;rand=$rand'><b><u>&laquo;</u></b></a>&nbsp;";


next step:
change urls responsible for sorting in template :
mylinks_viewcat.html (add &rand=0)

<a href="viewcat.php?cid=<{$category_id}>&orderby=titleA&rand=0">


third step: I think adding url for random ordering will be useful (becouse after choosing normal sorting you can't use random sorting, except clicking on main links to viewcat.php will bring random links)
<a href="viewcat.php?cid=<{$category_id}>"><img src="images/(some image, maybe question mark, which describes random sorting)" border="0" align="middle" alt="" />



I don't know if there above is a mistake. I didn't test it. I took it from head :)


KubaZ

Just popping in
Posted on: 2005/6/8 20:43
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#3

Re: Poll module question?

Yes, it can be done due to changing code. Please tell me, which version of XOOPS do you have, and then I'll prepare changed code of this mod. :)


KubaZ

Just popping in
Posted on: 2005/5/30 12:25
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#4

Email protection hack in userinfo.php

Hi XOOPS World :)

Few days ago I read in polish magazine the way of protecting emails, simply create image with email address and spam robot's will be unable to read our addresses :)

I've made a little hack to use this protection in my XOOPS service.

DEMO: http://www.kongresruchow.pl/userinfo.php?uid=1

LINK:
http://www.kongresruchow.pl/kuba/xoops/emailprotection.tgz (200kb)


files:
[new] ./emailprotection.php
[new] ./include/arial.ttf
[need to change] ./userinfo.php

requirements:
GD library
Your famous font (I've put only arial.ttf )

To run this hack you will have to change userinfo.php
so Find this code:
if ($thisUser->getVar('user_viewemail') == 1) {
    
$xoopsTpl->assign('user_email'$thisUser->getVar('email''E'));
} else {
    if (
is_object($xoopsUser)) {
         
// All admins will be allowed to see emails, even those that are not allowed to edit users (I think it's ok like this)
        
if ($xoopsUserIsAdmin || ($xoopsUser->getVar("uid") == $thisUser->getVar("uid"))) {
            
$xoopsTpl->assign('user_email'$thisUser->getVar('email''E'));
        } else {
            
$xoopsTpl->assign('user_email''&nbsp;');
        }
    }
}


and change it into :

if ($thisUser->getVar('user_viewemail') == 1) {
    
$protectedEmail '<img src="'.XOOPS_URL.'/emailprotection.php?uid='.$thisUser->getVar("uid").'">';
    
$xoopsTpl->assign('user_email'$protectedEmail);
} else {
    if (
is_object($xoopsUser)) {
         
// All admins will be allowed to see emails, even those that are not allowed to edit users (I think it's ok like this)
        
if ($xoopsUser->isAdmin() || ($xoopsUser->getVar("uid") == $thisUser->getVar("uid"))) {
            
$protectedEmail '<img src="'.XOOPS_URL.'/emailprotection.php?uid='.$thisUser->getVar("uid").'">';
            
$xoopsTpl->assign('user_email'$protectedEmail);
        } else {
            
$xoopsTpl->assign('user_email''&nbsp;');
        }
    }
}


(explanation: as you can see, I added one new line $protectedEmail = '<img src="'.XOOPS_URL.'/emailprotection.php?uid='.$thisUser->getVar("uid").'">';
which call our script file 'emailprotected.php'
and change
$xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E')); to $xoopsTpl->assign('user_email', $protectedEmail); to display image

TIPS: You can look into emailprotection.php if you want change color of font, size, etc.

And finally the link ! :
http://www.kongresruchow.pl/kuba/xoops/emailprotection.tgz (200kb)

It weight so much because of size of Arial.tff (stupid MS font)


KubaZ

Just popping in
Posted on: 2005/5/29 22:43
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#5

Re: Gadu-Gadu PL Hack - solved

It is very simple. You have to edit your template (because XOOPS uses Smarty Engine), which is located in :

modules/system/templates/system_userinfo.html.

There you have something like this:

<tr valign="top">
          <
td class="head"><{$lang_icq}></td>
          <
td class="odd"><{$user_icq}></td>
        </
tr>


so, you localized where you have to change
So introduce changes :

<tr valign="top">
          <
td class="head"><{$lang_icq}></td>
          <
td class="odd">
<
img src="http://www.gadu-gadu.pl/users/status.asp?id=<{$user_icq}>&styl=1">
<
a href="gg:"><{$user_icq}></a></td>
        </
tr>


to give output <img of status><gg:your gg number>

it's all :P


KubaZ

Just popping in
Posted on: 2005/1/3 19:31
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#6

sharing xoops' users database

Hi,

I'm wondering what (and how) I have to do to share user's database. For example if I have

www.myserver.com/xoops1/

www.myserver.com/xoops2/


and I would like after loging on one XOOPS system to be online on the other.

I think I need to use one user table I do hack on kernel files (user.php)

Is someone can help me solve this problem ?

thanks
KubaZ


KubaZ

Just popping in
Posted on: 2004/9/11 10:52
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#7

smarty problem ?

Hi,

I'm trying to resolve problem one of polish XOOPS user.

Please look at http://www.dragon.kielce.pl/kejti/xoops/

I think she has problem of smarty engine.. but maybe I don't think right.

can anyone help us.

for now I adviced to install newest version of XOOPS (2.0.7.2)
but still we have erros

2.0.7.2 ver -> at : http://www.dragon.kielce.pl/kejti/xoops3/index.php

baCio
KubaZ


KubaZ

Just popping in
Posted on: 2004/8/20 14:24
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#8

Re: Poll hack: show poll results in a block on start page

thanks for expanding my hack :)


KubaZ

Just popping in
Posted on: 2004/4/28 22:56
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#9

Re: Searching for a Counter-Strike server-module

Hi,

I put one module on my private local site, which queries cs game. But I've change it from exoops (but code wasn't diffrent in sense of security)..and I haven't done language files (I've changed in polish without language )

but now I'm searching for:
1. new script for CS query
2. change module to config via Web (now you must edit .txt file )

tomorrow, when I will back to my home I will look out


KubaZ

Just popping in
Posted on: 2004/4/28 12:30
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#10

Re: search user by name

Yes, I had a little problem with it.

but I've looked into finduser.php (in system module)

Quote:

$member_handler =& xoops_gethandler('member');

$criteria = new CriteriaCompo();

$criteria->add(new Criteria('uname',$komputer, '='));

$total = $member_handler->getUserCount($criteria);

$foundusers =& $member_handler->getUsers($criteria, true);


so it is as you wrote thanks thanks

(and 3rd parameter is a part MySQL language like ('LIKE', >=) function uses it in SQL query in connection with WHERE )



TopTop
(1) 2 3 4 »