xoops forums

Forum Index


Board index » All Posts (kerkyra)




kerkyra

Just can't stay away
Posted on: 2012/10/11 13:58
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#1

Re: getting values from xoops "users" table

for the user manipulation php-side you can create a new user class to extend the core user class.

this is part of something i have done to correct the avatar location issue with newer versions of xoops

I added your var in there so you could try it out of the box. Hopefully.

Quote:

include_once $GLOBALS['xoops']->path('kernel/user.php');


class myUser extends XoopsUser
{

private $db;
private $id;
function __construct($id=null)
{
parent::__construct($id);
$this->initVar('user_viewtel', XOBJ_DTYPE_INT, 1, false);


if($id>0)
{
$this->id = $id;


if(file_exists(XOOPS_ROOT_PATH."/uploads/".$this->getVar('user_avatar')))
$avatar="/uploads/".$this->getVar("user_avatar");
else
$avatar="/uploads/avatars/".$this->getVar("user_avatar");

$this->setVar('user_avatar',$avatar);

$this->db = Database::getInstance();


}
}



}


If you need new fields I would suggest creating a new table and store them in there seperatelly from xoops core db tables.

Then extend the class to store the extra values with a new method in it.

Make that a small module (just for the sake of neatness) or implement it in your module, and you dont have to worry about messing with the core :) hope it helps


kerkyra

Just can't stay away
Posted on: 2012/10/11 13:17
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#2

Re: how to avoid strange errors when we reach to memory_limit?

maybe if you dont use the count in mysql, and just use count(array()) in php to get the size of the results array??? just a suggestion.


kerkyra

Just can't stay away
Posted on: 2012/6/9 11:01
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#3

Re: News 1.67 hangs when submitting articles

the same thing happens with smartsection 2.14, i've been trying to figure it out for some time now. The problem originates server side and not client side. It probably has to do with the cache memory. I tried ob_end_flush after submiting the article and before the redirect. Seems to soften the blow a lil bit but doesnt solve the problem. Perhaps it has something to do with xoops object... :/
www.guidemap.gr - Beta is out...


kerkyra

Just can't stay away
Posted on: 2012/3/12 1:49
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#4

Re: Strange issue when i change my domain name

my first guess would be that something is not loading corectly! I think first of all you should check that every file (css, js etc) is indeed loading corectly. And if they do try uploading the files again in case there was an error during the transfer mate. :/
www.guidemap.gr - Beta is out...


kerkyra

Just can't stay away
Posted on: 2011/12/12 11:06
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#5

Re: block id in theme

you can also use the block id in your themes like this

Quote:

<div>
<{if $block.title != ""}>
<div class="blockTitle blocktitle<{$block.id}>" ><{$block.title}></div>
<{/if}>
<div class="blockContent content<{$block.id}>"><{$block.content}></div>
</div>


then you can use css to edit the appearance of a specific block like this
Quote:

.blocktitle10 {css for title in here}
.content10 {css for content in here}


Of course you have to create your block first (so you can identufy its id)
and then write its css.


kerkyra

Just can't stay away
Posted on: 2011/12/6 11:09
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#6

Re: How to create a cron in Xoops

i managed to figure this out, so here are my observations.

if you would like to run a cron job and use existing xoops functions, constants etc you would have to

1. include the mainfile.php
Quote:
include_once("root_path/httpdocs/mainfile.php");

where root_path is the absolute root path to your site

2. include the xoopslogger class and disable it (in case it is on)
Quote:

include_once XOOPS_ROOT_PATH.'/class/logger/xoopslogger.php';
$xoopsLogger =& XoopsLogger::getInstance();
$xoopsLogger->activated = false;
error_reporting(0);

as you can see i disabled error reporting as well, this is not mandatory (i think) but I did it anyway since I finished my debugging.

3. set the cron in your cpanel/plesk or whatever

Thats actually it. Now you can use any core functionality like xoops_load(), $xoopsDB etc, or load any languages on the fly as we would do in a module function.

I implemented this for a newsletter module i'm writing and its working fine so far. I hope it helps someone.

Maybe when i'm done with the module i will share it with the rest, although it is designed to serve my websites needs, and its based on the same logic as my Xoops Global RSS Hack/Solution.

I just want to share the logic.

Both global RSS and Newsletter functionality is missing from xoops but that doesn't mean we cant have it :) (without touching core files)


kerkyra

Just can't stay away
Posted on: 2011/12/3 13:05
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#7

Re: How to create a cron in Xoops

unfortunately i'm on plesk, i did something tha partially worked. I could use pure php to do this, but i want to include the xoops core so i can use some of its functionality.

It seems that there is something wrong with protector and/or the debugging information and for some reason i cant turn them off while running the cron... I'm not sure about this, i'm looking into it and trying things (trial and error).

If i figure it out i will post my observations here for the rest to have something to start with. :)
www.guidemap.gr - Beta is out...


kerkyra

Just can't stay away
Posted on: 2011/12/2 11:25
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#8

Re: How to create a cron in Xoops

thanks for the replies mates! I'll give it a try and see what i can do.
if i find anything usefull i'll post it here :)
www.guidemap.gr - Beta is out...


kerkyra

Just can't stay away
Posted on: 2011/12/1 16:33
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#9

How to create a cron in Xoops

Does anybody know how to create o cron job in xoops? I have made an effort but it only runs through the web browser.

If i set it up to run from the server it gets stuck and i think the problem is protector or something like that.

Any ideas what i should include in the header? Or not include...


kerkyra

Just can't stay away
Posted on: 2011/9/9 12:18
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#10

HOW-TO: Have different styles for each block individually and control title visibility through css

I recently found an easy way to control how my blocks show individually.

here it is....

Quote:

<div class="rightblock" align="right">
<div class="blockTitle block<{$block.id}>" ><{$block.title}></div>
<div class="blockContent content<{$block.id}>"><{$block.content}></div>
</div>


Every block has an id once saved, so in my rightblocks.html template, I add a class to my title div and one class to my content div (could also be an id instead of a second class, whatever suites you)

In the example above the title has the block<{$block.id}> class
and the content area has the content<{$block.id}> class

So now if we examine the webpage's html we can see the actual class names of every block, and write the css for each one of them individually. :) while maintaining the basic characteristics of the primary classes.

I hope it helps someone.



TopTop
(1) 2 3 4 ... 40 »