41
rplima2004
Re: Edit error in Xoops
  • 2006/9/12 13:02

  • rplima2004

  • Just popping in

  • Posts: 70

  • Since: 2004/10/8


Hi RaMoFM,

This error normally is about connection error on the database.
Check if in mainfile.php the parameters of database connections is OK (host, user, passwd, prefix, database). If all OK, contact your host and asks about problems in the MySQL system.

Rodrigo



42
rplima2004
Re: How to connect xoopsDB in theme.html
  • 2006/9/12 5:36

  • rplima2004

  • Just popping in

  • Posts: 70

  • Since: 2004/10/8


Sorry, my example are created on XOOPS 2015 and your version is 2.2.X

Insert the code on the final of file, before the tag ?>

Quote:

<?php
// $Id: header.php 185 2006-01-22 23:49:01Z skalpa $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <https://xoops.org/> //
// ------------------------------------------------------------------------ //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
if (!defined("XOOPS_ROOT_PATH")) {
die("XOOPS root path not defined");
}

// Ensure charset setting
if (!headers_sent()) {
header('Content-Type:text/html; charset='._CHARSET);
}

$GLOBALS['xoopsLogger']->context = "core";

// Get blocks
$block_handler =& xoops_gethandler('block');
$block_handler->assignBlocks();

$GLOBALS['xTheme']->checkCache();

if (!isset($GLOBALS['xoopsOption']['template_main'])) {
// new themes using Smarty does not have old functions that are required in old modules, so include them now
include XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
// need this also
$xoopsTheme['thename'] = $GLOBALS['xoopsConfig']['theme_set'];


}
$GLOBALS['xoopsLogger']->context = "module";
/*
*Hack by rplima to show random quotes in the theme
*/
global $xoopsDB;
$sql="select texto,autor from ".$xoopsDB->prefix("xoops_citas")." ORDER BY RAND() LIMIT 10";
$result = $xoopsDB->query($sql) ;
$i = 0;
while(list($texto,$autor)=$xoopsDB->fetchRow($result)){
$arr_quotes[$i]['text'] = $texto;
$arr_quotes[$i]['author'] = $autor;
$i++;
}
$xoopsTpl->assign('arr_quotes',$arr_quotes);
/*
*End of hack
*/
?>



43
rplima2004
Re: Offering a promotion
  • 2006/9/11 17:42

  • rplima2004

  • Just popping in

  • Posts: 70

  • Since: 2004/10/8


hi coops,

In this thread (in Portuguese, translated by google), i implemented a way to user, on registration form, select of which group would like to participate.

I know that this does not decide its problem, however it can serve as you so that he develops something.

att

Rodrigo



44
rplima2004
Re: How to connect xoopsDB in theme.html
  • 2006/9/11 15:35

  • rplima2004

  • Just popping in

  • Posts: 70

  • Since: 2004/10/8


Try to use this:

On the final of XOOPS_ROOT_PATH/header.php, before the
Quote:

}
?>


insert this code:
Quote:

global $xoopsDB;
$sql="select texto,autor from ".$xoopsDB->prefix("xoops_citas")." ORDER BY RAND() LIMIT 10";
$result = $xoopsDB->query($sql) ;
$i = 0;
while(list($texto,$autor)=$xoopsDB->fetchRow($result)){
$arr_quotes[$i]['text'] = $texto;
$arr_quotes[$i]['author'] = $autor;
$i++;
}
$xoopsTpl->assign('arr_quotes',$arr_quotes);


Now, on the theme.html put this code in the exact place that you want to show the quotes
Quote:

<div id="randomquote">
<{foreach item=quote from=$arr_quotes}>
<p><{$quote.text}></p>
<p><{$quote.author}></p>
<br />
<{/foreach}>
</div>


Soon, the code will return 10 quotes/authors and show on theme. To define the amount of quotes you want change the 10 on the sql query for the number you want.

att

Rodrigo



45
rplima2004
Re: need a banner
  • 2006/9/11 3:29

  • rplima2004

  • Just popping in

  • Posts: 70

  • Since: 2004/10/8





46
rplima2004
Re: More than one banner?

hi urbanspacema,

Unhappyly the current version does not have templates and in case that it wants to modify the layout of the block will have that to edit the archive blocks/banner.php manually.

Templates for the blocks already is ready, only lacks to create templates of the administrative area of the module.

These templates and new blocks and functions already will be enclosed in the new version that will be launched in briefing, also with translation for other languages.

Visits my site (http://www.bcsg.com.br/rwbanner) of some days and sees if the new version of the module already is available.


Rodrigo



47
rplima2004
Re: More than one banner?
  • 2006/3/21 5:46

  • rplima2004

  • Just popping in

  • Posts: 70

  • Since: 2004/10/8


Hello fallenangel,

I implemented a new block in the module rw_banner that he accurately makes what you desire, it changes the image automatically without giving refresh in the page.

You can see it in functioning here.

The block was placed in the top header of the site and to each 30 seconds it changes the image.

This new version of rw-banner still is not available for download because it is in period of tests but until the end of the month it will be ready.



ps: The language of the site is Portuguese, but through the systems of google you will obtain translate it easily.

ps2: Sorry for my poor english, this text was translated by google.

[]s
Rodrigo



48
rplima2004
Re: More than one banner?
  • 2006/3/20 20:33

  • rplima2004

  • Just popping in

  • Posts: 70

  • Since: 2004/10/8


Hello fallenangel, all good?

I understood what you want. What you want are to show randomic images in header of its site without refresh in the pages, is not this?

The reply for its problem is ajax. Ajax uses of the XMLHttpRequest technology to create dynamic contents without giving refresh in the pages.

And now in the new version of rw_banner you will be able to use this therefore it comes with a block that shows banners using the technology ajax.

It waits, in briefing the new version will be available.

[]s
rplima



49
rplima2004
Login's System Hack
  • 2005/9/8 11:37

  • rplima2004

  • Just popping in

  • Posts: 70

  • Since: 2004/10/8


Good Morning,

During these days it was questioned me by a customer if it would be possible to limit the system of login of xoops. The limit: not to allow to a loged user already in the site to use this exactly username and password to enter in another session while himself still was loged in.

After very searching, I didn't find no referring to this question in our forums or in the communities, therefore I write this topic in forum of XOOPS Brasil community, which I am part of the group of Support and Contribution. This topic can be seen in this adress.

Based in the answers of this forum, I developed a small hack of the login's system that it decided this problem. And I decided too, to share it with all because it can be of the interest of other xoopers. Thank's to my friends Topet and David for the great tips and to Léu for the translation of this post.

Of course, that’s enough, go hack:

Quote:

//Hack’s Start by rplima
// This hack serves to check if the user already is logged in the site, in case that he is does not allow new login
$query = $xoopsDB->queryF('SELECT * FROM '.$xoopsDB->prefix('online').' WHERE online_uname="'.$uname.'"');
$total = $xoopsDB->getRowsNum($query);
if ($total){
$msg = 'Sorry '.$uname.' But, it wasn’t possible effect your login in the site !! < br />
< p align="left" style="color:red;">
Possibilities:< br />
- You already are logged in the site.< br />
- Somebody logged in the site using your username and password.< br />
- You left the site or close the window of your navigator without click in "logout" link. < br/>
< /p>
Wait some minutes and try again. If the problem persists contact us using the contact form, click in
< a href="'.XOOPS_URL.'/modules/contact/">aqui< /a>.';
redirect_header(XOOPS_URL.'/index.php', 12, $msg);
exit();
}
//Hack’s end


This hack must be placed in the file include/checklogin.php below of line 49 (xoops 2.0.13).
Below you find a stretch of the code until the line 49 to easy localization:

Quote:

$member_handler =& xoops_gethandler('member');
$myts =& MyTextsanitizer::getInstance();
$user =& $member_handler->loginUser($myts->addSlashes($uname), $myts->addSlashes($pass));
if (false != $user) {
if (0 == $user->getVar('level')) {
redirect_header(XOOPS_URL.'/index.php', 5, _US_NOACTTPADM);
exit();
}


Write a new line below “}” and put the hack.

Save file and up again for sever.

I hope that it is useful for you, therefore for me solved a problem and allowed me make more one work using XOOPS.

Greetings for all..


Rodrigo


************************************************************
Para a comunidade XOOPS de Lingua Portuguesa

Bom dia a todos,

Durante esses dias me foi questionado por um cliente se seria possível limitar o sistema de login do xoops, limitar no sentido de não permitir a um usuário já logado no site de usar este mesmo nome de usuário e senha para efetuar outra sessão ao site enquanto o mesmo ainda estivesse logado.

Depois de muito pesquisar, não achei nada referente a essa questão nos fóruns das comunidades que frequento, portanto lancei este tópico no fórum da comunidade XOOPS Brasil, a qual faço parte do grupo de Suporte e Colaboração. Este tópico pode ser visto aqui.

Com base nas respostas deste fórum, desenvolvi um pequeno hack do sistema de login que resolveu este problema, portanto resolvi compartilhá-lo com todos por achar que o mesmo pode ser do interesse de outros usuários xoops. Gostaria de agradecer também aos amigos Topet e David pelas dicas valiosas e ao amigo Leo pela tradução deste post.

Bom, chega de papo, vamos ao hack.

Quote:

//Inicio do hack by rplima
//Este hack serve para checar se o usuário ja está logado no site, caso esteja não permite novo login
$query = $xoopsDB->queryF('SELECT * FROM '.$xoopsDB->prefix('online').' WHERE online_uname="'.$uname.'"');
$total = $xoopsDB->getRowsNum($query);
if ($total){
$msg = 'Desculpe '.$uname.' mas não foi possível efetuar o login no site!! < br />
< p align="left" style="color:red;">
Possíveis causas:< br />
- Você já está logado no site.< br />
- Alguém logou no site utilizando seu nome de usuário e senha.< br />
- Você saiu do site ou fechou a janela do navegador sem clicar no link de logout.< br />
< /p>
Aguarde alguns minutos e tente novamente. Caso o problema persista entre em contato conosco através do formulário de contato clicando
< a href="'.XOOPS_URL.'/modules/contact/">aqui< /a>.';
redirect_header(XOOPS_URL.'/index.php', 12, $msg);
exit();
}
//Fim do hack


Este hack deve ser colocado no arquivo include/checklogin.php logo abaixo da linha 49 (xoops 2.0.13).
Abaixo vc encontra um trecho do código até chegar na linha 49 para facilitar a localização da mesma caso a sua versão não seja a mesma que a minha.

Quote:

$member_handler =& xoops_gethandler('member');
$myts =& MyTextsanitizer::getInstance();
$user =& $member_handler->loginUser($myts->addSlashes($uname), $myts->addSlashes($pass));
if (false != $user) {
if (0 == $user->getVar('level')) {
redirect_header(XOOPS_URL.'/index.php', 5, _US_NOACTTPADM);
exit();
}


Abra uma linha nova logo abaixo do } e coloque o hack aí.

Basta salvar o arquivo e uppar novamente para o servidor.

Espero que seja útil para vocês, pois pra mim solucionou um problema e me permitiu realizar mais um trabalho envolvendo o xoops.

Abraços a todos.


Rodrigo



50
rplima2004
Xoops in 2 languages
  • 2005/1/12 18:40

  • rplima2004

  • Just popping in

  • Posts: 70

  • Since: 2004/10/8


Hi, I am making a site for a necessary customer and who the site functions simultaneously in 2 languages (Portuguese and Spanish), depending on the choice of the user.
Somebody has an idea of as to make this, since the service of google beyond not translating of the Portuguese language for the Spanish language it does not translate the session, therefore if the user to make login and to translate the site goes to have that to make login of new and when making the site comes back toward the original language.
I do not know if type exists something soon it, but necessary script or module is of one that translates the site all, modules, blocks and content.
Will be there that somebody already passed therefore or knows as decides the problem? Since already obliged to all.

Rodrigo




TopTop
« 1 2 3 4 (5) 6 »



Login

Who's Online

223 user(s) are online (154 user(s) are browsing Support Forums)


Members: 0


Guests: 223


more...

Donat-O-Meter

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

Latest GitHub Commits