1
kerkyra
Re: getting values from xoops "users" table
  • 2012/10/11 13:58

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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



2
kerkyra
Re: how to avoid strange errors when we reach to memory_limit?
  • 2012/10/11 13:17

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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.



3
kerkyra
Re: News 1.67 hangs when submitting articles
  • 2012/6/9 11:01

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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...



4
kerkyra
Re: Strange issue when i change my domain name
  • 2012/3/12 1:49

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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...



5
kerkyra
Re: block id in theme
  • 2011/12/12 11:06

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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.



6
kerkyra
Re: How to create a cron in Xoops
  • 2011/12/6 11:09

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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)



7
kerkyra
Re: How to create a cron in Xoops
  • 2011/12/3 13:05

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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...



8
kerkyra
Re: How to create a cron in Xoops
  • 2011/12/2 11:25

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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...



9
kerkyra
How to create a cron in Xoops
  • 2011/12/1 16:33

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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...



10
kerkyra
HOW-TO: Have different styles for each block individually and control title visibility through css
  • 2011/9/9 12:18

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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 »



Login

Who's Online

191 user(s) are online (121 user(s) are browsing Support Forums)


Members: 0


Guests: 191


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits