521
tzvook
Re: List Links In Alphabetical Order???
  • 2005/2/24 9:19

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


The Hack code + help with it is here:
https://xoops.org/modules/newbb/viewtopic.php?topic_id=32229&forum=4&post_id=140621#forumpost140621
This one continue the thread (sorry I didn't post it here ... forgot about this thread)



522
tzvook
Xdirectory Alphabetic Order Hack ... need fresh eyes
  • 2005/2/24 8:52

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Hi All

Quite long ago I needed alphabetic sorting for the Xdir, with help from riaanvdb I got it to work.
I didn't used it for a while, but now I found out it acts weirdly!!! very weirdly

Sometimes it gives the right list in the right letter, sometimes it don't (clicking "a" or "b" or "c" or "d" gives the "a" list all the time, but clicking on "g" gives the "g" list all the time - it acts badly ... but in a constant manner , and I really don't see the logic in it.

It comes originaly (I think ... don't remember) from the WF downloads alphanetic sorting - looks almost the same

I post the codes here for someone to take a look, changed from Hebrew to English .....

file: include/functions.php (eof - at the end of it add this function)

function letters()
{
    global 
$xoopsModule;

    
$letterchoice .= "[  ";
    
$alphabet = array ("0""1""2""3""4""5""6""7""8""9""A""B""C""D""E""F""G""H""I""J""K""L""M""N""O""P""Q""R""S""T""U""V""W""X""Y""Z");
    
$num count($alphabet) - 1;
    
$counter 0;
    while (list(, 
$ltr) = each($alphabet))
    {
        
$letterchoice .= "<a href='viewlist.php?rate=1&list=$ltr' style='font-size: 11px;'><font size='2'>$ltr</font></a>";
        if (
$counter == round($num 2))
            
$letterchoice .= " ]<br />[ ";
        elseif (
$counter != $num)
            
$letterchoice .= "&nbsp;|&nbsp;";
        
$counter++;
    } 
    
$letterchoice .= " ]";
    return 
$letterchoice;
}


viewlist.php (complete) looks like this:
include "header.php";
$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
$mytree = new XoopsTree($xoopsDB->prefix("xdir_cat"),"cid","pid");
$xoopsOption['template_main'] = 'xdir_viewlist.html';
include 
XOOPS_ROOT_PATH."/header.php";
//generates top 10 charts by rating and hits for each main category

$list $HTTP_GET_VARS['list'];
$rate $HTTP_GET_VARS['rate'];

// Tzvook //
$letters letters();
$xoopsTpl->assign('letters'$letters);
$xoopsTpl->assign('xmid'$xoopsModule->getVar('mid'));

if(isset(
$rate)){
    
$sort _MD_RATING;
    
$sortDB "rating";
}else{
    
$sort _MD_HITS;
    
$sortDB "hits";
}
$xoopsTpl->assign('lang_sortby' ,$sort);
$xoopsTpl->assign('lang_rank' _MD_RANK);
$xoopsTpl->assign('lang_phone'_MD_BUSPHONE);
$xoopsTpl->assign('lang_title' _MD_TITLE);
$xoopsTpl->assign('lang_category' _MD_CATEGORY);
$xoopsTpl->assign('lang_hits' _MD_HITS);
$xoopsTpl->assign('lang_rating' _MD_RATING);
$xoopsTpl->assign('lang_vote' _MD_VOTE);
$arr=array();
$result=$xoopsDB->query("select cid, title from ".$xoopsDB->prefix("xdir_cat")." where pid=0");
$e 0;
$rankings = array();
while(list(
$cid$ctitle)=$xoopsDB->fetchRow($result)){
    
$rankings[$e]['title'] = sprintf(_MD_TOP10$myts->htmlSpecialChars($ctitle));
    
$query "select lid, cid, title, phone, hits, rating, votes from ".$xoopsDB->prefix("xdir_links")." where status>0 and (title LIKE '$list%'";
    
// get all child cat ids for a given cat id
    
$arr=$mytree->getAllChildId($cid);
    
$size count($arr);
    for(
$i=0;$i<$size;$i++){
        
$query .= " or cid=".$arr[$i]."";
    }
    
$query .= ") order by ".$sortDB." DESC";
    
$result2 $xoopsDB->query($query,50,0);
    
$rank 1;
    while(list(
$lid,$lcid,$ltitle,$phone,$hits,$rating,$votes)=$xoopsDB->fetchRow($result2)){
        
$catpath $mytree->getPathFromId($lcid"title");
        
$catpathsubstr($catpath1);
        
$catpath str_replace("/"," <span class='fg2'>&raquo;</span> ",$catpath);
        
$rankings[$e]['links'][] = array('id' => $lid'cid' => $cid'rank' => $rank'title' => $myts->htmlSpecialChars($ltitle), 'category' => $catpath'hits' => $hits'rating' => number_format($rating2), 'votes' => $votes'phone' => $phone);
        
$rank++;
    }
    
$e++;
}
$xoopsTpl->assign('rankings'$rankings);
include 
XOOPS_ROOT_PATH.'/footer.php';
?>


in each file I want the Alphabetic order - I call the function ( files: index.php , viewcat.php , singlelink.php ) and in it's templates acordingly I call it:
<{$letters}>

(the template is full of hebrew hardcoded Chars - so I can't post it in full, but you need to add this wherever you want the alpabetic line to be) ...

Thsi hack is almost working good ... exept of what I mentioned above.
I wonder if somebody (from all those who asked me before about it) finds the fix for that
I am realy lost with it ... need fresh eyes on that one !!!!



523
tzvook
Re: [myEDITO] A user homepage version for test
  • 2005/2/23 23:15

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Sugestions/features request:

- Alphabetic + categoric sorting of users/homepages for big sites.
- A hack for linking each user (from user's details core file) to his homepage.

I'll think of more ... ...



524
tzvook
Re: fix for xdirectory & alumni search, no mid.
  • 2005/2/23 17:07

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


10x man

works like a charm (though I had to add the line
$xoopsTpl->assign('xmid', $xoopsModule->getVar('mid'));
also in "viewcat.php" and in "viewlist.php" .... wherever I put a search show)

Your'e right, very usefull - I was looking for that "small" solution for a long time.



525
tzvook
Re: XF Guestbook
  • 2005/2/13 21:12

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Hi All
I have a problem with the module: I'm using a wysiwyg for the whole site, all is great, but in XF Guestbook , the html of the wysiwyg is showing at the massages:

<p><font style="background-color: #33cc00">my texts here ....</fonttext .......<br /><br /><strong><u>Tzvook</u></strong><br /><br /><br /><br /><br /><br /><br /><br /><br /></p><p>&nbsp;</p>


I looked @ the code, but didn't recognise the cause of this

Is there any way of Enabling Html in massages ?



526
tzvook
Re: OT Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops
  • 2005/2/5 1:36

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


samuels
It seems that what I saw was old, didn't saw that one, is there a link to a demo of the last version ?



527
tzvook
Re: OT Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops
  • 2005/2/4 21:19

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

samuels wrote:
@tzvook
As you know Htmlarea has a huge community behind, helping, reporting bugs e.t.c.


Being in this community for a few years now, made all other wysiwyg looks behind.
there's a few image managers for htmlarea out there, one is mine, but that's not the reason I mentioned it, the good ones let you easily and friendly manage images on server + a lot of other options in it (sub directories in the images root dir, delete dirs/images, controll hspace, vspace, full alignment, title, alt, rename on the fly during upload .... and more....
2.03 is bugless though just IE, and is slow just if you fill it with addons.
3.0 rc 3 is great and support mozila + firefox for mac and so on.... and is much faster!!!!

Anyway, I can see kiovi is improoving fast , so .....



528
tzvook
Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops
  • 2005/2/3 19:53

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Well, I found it very buggy, image management is very bad and less friendly to end user.
Yep SPAW is not bad but is not enough feature rich...



529
tzvook
Re: [mini guide] How to quickly replace all the textarea with kiovi in Xoops
  • 2005/2/3 19:15

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Hello
Sorry to say that, but every time I see someone mention the Koivi editor I try yo see if it changed, and , well, it's way behind SPAW or HTMLAREA !!!

Why going to that direction?
one who used to htmlarea wouldn't come close to Koivi!!!
Is there something I'm missing ?



530
tzvook
Re: search on specific module only
  • 2005/1/25 9:17

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

Mithrandir wrote:
Replace 5 with the id of the module you want searched.


Is there any way to use it dynamicly ($var) ?
for use in a new module ...




TopTop
« 1 ... 50 51 52 (53) 54 55 56 ... 60 »



Login

Who's Online

165 user(s) are online (86 user(s) are browsing Support Forums)


Members: 0


Guests: 165


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