141
javier
Re: Wht´s to clone... anything?
  • 2004/3/30 10:37

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


Hola fcomoron,
que es exactamente lo que quieres hacer? clonar un modulo, un bloque?
para hacer scroll en un bloque te sugiero que leas este articulo en la pagina de "soporte XOOPS en español"

http://www.esxoops.com/modules/news/article.php?storyid=90

saludos.

--------------------------------------------------
english:
Hi fcomoron,
what exactly you want to do? clone a module,a block?
for make a block scroll i suggest you read this article in the "xoops spanish support website"

http://www.esxoops.com/modules/news/article.php?storyid=90

grettings.


ps: my english is not good. ;)




142
javier
Re: help with mysql query in latest downloads block
  • 2004/3/30 0:20

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


i added xoops_ to both table names,
because i get this error

SELECT cid FROM mydownloads_cat WHERE pid=8
Error number: 1146
Error message: Table 'site.mydownloads_cat' doesn't exist

i modified mydownloads_cat to xoops_mydownloads_cat and solved, because i have my tables with the XOOPS prefix.
that´s a detail only
----------------

now the true stuff:
this is the code:

include (XOOPS_ROOT_PATH."/class/xoopstree.php");
$xt = new XoopsTree('xoops_mydownloads_cat'"cid""pid");
$categories $xt->getAllChildId(8);
$categorystring "(";
foreach (
$categories as $key => $categoryid) {
    if (
$key != 0) { //Only comma-separate subsequent categories
        
$categorystring .= ", ";
    }
    
$categorystring .= $categoryid;
}
$categorystring ")";
$result $xoopsDB->query("SELECT lid, cid, title, date, hits FROM 'xoops_mydownloads_downloads' WHERE cid IN ".$categorystring." ORDER BY ".$options[0]." DESC"$options[1], 0);


and this is the MySQL debug:

SELECT lidcidtitledatehits FROM 'xoops_mydownloads_downloads' WHERE cid IN ORDER BY date DESC LIMIT 010
Error number
1064
Error message
You have an error in your SQL syntax near ''xoops_mydownloads_downloads' WHERE cid IN ) ORDER BY date DESC LIMIT 0, 10' at line 1




143
javier
Re: help with mysql query in latest downloads block
  • 2004/3/29 20:48

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


ohh, a prefix appear in my code, who was the guilty?

i removed the prefix and fix the space in front of ORDER,

now i get:

php debug:
Fatal error: Cannot instantiate non-existent class: xoopstree in c:\phpdev5\www\site\modules\mydownloads\blocks\mydownloads_top.php on line 19

man sincerely i feel shame, im abusing of your time
thanks for your explanations,you have alot of patience.



144
javier
Re: help with mysql query in latest downloads block
  • 2004/3/29 19:40

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


sure, sorry for forget about php debug:

Parse error: parse error, unexpected T_STRING in c:\phpdev5\www\site\modules\mydownloads\blocks\mydownloads_top.php on line 19

the line 19 is
$xt = new XoopsTree(".$xoopsDB->prefix("mydownloads_cat")." "cid""pid");


----


function b_mydownloads_top_show($options) {
    global 
$xoopsDB;
    
$block = array();
    
$myts =& MyTextSanitizer::getInstance();
    
//$order = date for most recent reviews
    //$order = hits for most popular reviews

$xt = new XoopsTree(".$xoopsDB->prefix("mydownloads_cat")." "cid""pid");
$categories $xt->getAllChildId(9);
$categorystring "(";
foreach (
$categories as $key => $categoryid) {
    if (
$key != 0) { //Only comma-separate subsequent categories
        
$categorystring .= ", ";
    }
    
$categorystring .= $categoryid;
}
$categorystring ")";
$result $xoopsDB->query("SELECT lid, cid, title, date, hits FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE cid IN ".$categorystring." ORDER BY".$options[0]." DESC"$options[1], 0);
while(
$myrow=$xoopsDB->fetchArray($result)){
        
$download = array();
        
$title $myts->makeTboxData4Show($myrow["title"]);
        if ( !
XOOPS_USE_MULTIBYTES ) {
            if (
strlen($myrow['title']) >= $options[2]) {
                
$title $myts->makeTboxData4Show(substr($myrow['title'],0,($options[2] -1)))."...";
            }
        }
        
$download['id'] = $myrow['lid'];
                
$download['pid'] = $myrow['pid'];
        
$download['cid'] = $myrow['cid'];
        
$download['title'] = $title;
        if(
$options[0] == "date"){
            
$download['date'] = formatTimestamp($myrow['date'],"s");
        }elseif(
$options[0] == "hits"){
            
$download['hits'] = $myrow['hits'];





145
javier
Re: help with mysql query in latest downloads block
  • 2004/3/29 16:29

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


Hi, thanks for taking your time for reply,

the alternate approach sound much better to go for me,

i tried but not work ,the MySQL debug not give errors (the query is not there)
maybe i made something wrong? i replaced $category_id_you_want_on_top
with $9 wich is the main category.

grettings and thanks again.



146
javier
Re: help with mysql query in latest downloads block
  • 2004/3/29 13:11

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


maybe i made a error when i added the code?

$result $xoopsDB->query("SELECT lid, cid, title, date, hits FROM ".$xoopsDB->prefix("mydownloads_downloads")." AS d LEFT JOIN ".$xoopsDB->prefix("mydownloads_cat")." AS c ON c.pid = d.cid WHERE d.cid = 9 OR c.pid = 9 AND status>0 ORDER BY ".$options[0]." DESC",$options[1],0);



147
javier
Re: help with mysql query in latest downloads block
  • 2004/3/26 19:18

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


please don´t leave me alone just now guys, anyone? i only need these modification for put my site online.



148
javier
Re: How to center images
  • 2004/3/26 12:01

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


the fast way is insert
<div align="center">your image url</div>
in your article.

grettings.



149
javier
Re: help with mysql query in latest downloads block
  • 2004/3/24 1:59

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


Thanks again Dave for take some of your time for reply me.

the above code not work,i was my fault i give you incorrect data
i was viewing the table estructures and i think the following data can be util:


in the xoops_mydownloads_cat table:

files (Main category cid=9 pid=0)
----> themes (subcategory cid=15 pid=9)
----> hacks (subcategory cid= 17 pid=9)

Them the main category has cid=9 and the pid of course is 0
the subcategorys has his own cid but the pid is the main category cid.

cid | pid | title
------------------
9 | 0 | files
15 | 9 | themes
17 | 9 | hacks

grettings




150
javier
Re: HELP PLEASE - Linking Module Question
  • 2004/3/23 22:31

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


Hi
For display always the newest links first:

inside Mylinks module ,search viewcat.php file.

Viewcat.php
change
$orderby "title ASC";

to
$orderby "date ASC";


-----------------------
For remove the sort by title option, simply modify the template file:

in your admin panel, go to system admin--->templates-->Web Links--->mylinks_viewcat.html

and remove the following:

<{$lang_title}> (<a href="viewcat.php?cid=<{$category_id}>&orderby=titleA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&orderby=titleD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)


Good Luck




TopTop
« 1 ... 12 13 14 (15) 16 17 »



Login

Who's Online

162 user(s) are online (99 user(s) are browsing Support Forums)


Members: 0


Guests: 162


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