501
tzvook
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes
  • 2005/3/21 9:19

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:
wtravel wrote:
Can you check which queries the MySQL debug window comes up with and post it to me when you click on the 'b' letter (list)?


I'm uploading it to my localhost site, as I can't do it on a "Live" site....
Probably a bit later ...



502
tzvook
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes
  • 2005/3/20 7:41

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Hello Martijn
I'm trying to find out how it can be used as a wide system module hack, and the "letter" function is quite easy to implement @ modules like "MyLinks , Xdirectory , Xphones (Xdir hack) and so on" so help is needed in that area (can you look @ the code I posted from phpNuke ?)

I'm aware of your new project and waiting for the first release
but I'm looking a wider solution - that could be impolemented if needed to a lot of modules - the Alphabet search menu is quite importand for sites with 1000 members and above - especialy for modules that deals with phonebooks or members homepages - to my opinion, users are the heart of every site/system and as such , user interface needs to be the first concern of the developer (which xoops, though is an amasing system, is not so good at ... so I try to improove user's ability fo find things without the need to go to XOOPS search all the time).

Quite funny that no module has this option working correctly, 5 address modules in the Repository, non with alphabetic order ..... I want to make a hackd Xdir for that, but the "letters()" code is not acurate and as seen @ the PHPnuke ... is just part of the full code.



503
tzvook
Re: Xdirectory Alphabetic Order Hack ... need fresh eyes
  • 2005/3/19 22:53

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

wtravel wrote:
tzvook,

It should be possible to get all first letters of data in a column from the query results, but that would still require the query to get all results.

What I would do is create an extra column with the first letter of the category or title or whatever column you would like to use to filter on alphabet. Update the column with the first letters of the already existing data, and adjust the insert and update queries to fill this column based on the data entry.

Then you can adjust the query to only select records that match the letter in the "alphabetical" parameter in your url. This will not only speed up queries, it will also save calculation time.

Martijn


Yep, will speed up for sure, but then you'll need to do it also when editing a record, when users asking to modify it ....



504
tzvook
Re: Image Manager
  • 2005/3/18 13:10

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

abbey wrote:
Guys am a new user of XOOPS and I am really thrilled working with it on my site ...http://www.ghanamusic.com/html [not fully operational yet].

I have 3 major concerns here.

1. how do I put a caption under the images that I upload with the image manager? Especially images that accompany the articles under the news section.

2. It it possible to have some padding around the image so that the text of the article is not too close to it?

3. Is it possible to specify a border around the image so that it stands out?

Thanks


Hello abbey
The only way I know is to use one of the WYSIWYG's editors for that - Samuel's Koivi Editor is good and can replace almost every XOOPS textarea with a core hack.

CAREFULL - b4 you try using WYSIWYG read about them by searching the forums - might be a security hazard.
the Koivi has an Image "properties screen which do what you need.
HtmlArea is doing it also, and has it's own ImageManager for all images functions.



505
tzvook
Re: How patch & update modules that are ports (eg from OScommerce)
  • 2005/3/18 13:00

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

Mr_RealSurf wrote:
some of the modules I most want to add to my XOOPS site are ports of pre-existing applications. To be specific, I currently use the following on my non-xoops site:

*phpAdsNew
-Don


Hello Don
I used the phpAdsNew module, but from the 'upgrades' reason simply stoped using the module and started using the original - there's no reason to use the module ... they are almost the same anyway.

use the original and call the banners through your theme or with the help of HTML custum blocks.

phpAdsNew is great !!!!



506
tzvook
Alphabetic Order as done @ Phpnuke
  • 2005/3/18 10:54

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


This is how Alpha order is done @ Phpnuke (for members lists) - means how rows are being counted and limited

I couldn't implement it - 3 hours of trying .... my head is exploading

http://www.hitwalker.nl/Snippet_library/index.php?cat_select=Phpnuke_related&show=Memberslist60_with_CNB_your_Account_


<?php 

/************************************************************************/ 
/* PHP-NUKE: Web Portal System                                          */ 
/* ===========================                                          */ 
/*                                                                      */ 
/* Copyright (c) 2002 by Francisco Burzi                                */ 
/* http://phpnuke.org                                                   */ 
/*                                                                      */ 
/* =========================                                            */ 
/* Based on MyPHPortal Modified MembersList                             */ 
/*                                                                      */ 
/* 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.       */ 
/* Modified by chatserv of http://www.nukeresources.com to work under   */ 
/* CNB Your Account                                                     */ 
/************************************************************************/ 

/* Some code taken from MemberList coded by Paul Joseph Thompson */ 
/* of www.slug.okstate.edu                                       */ 
/* In memoriam of Members List War ;)                            */ 

if (!eregi("modules.php"$PHP_SELF)) { 
    die (
"You can't access this file directly..."); 


require_once(
"mainfile.php"); 
$module_name basename(dirname(__FILE__)); 
get_lang($module_name); 

function 
alpha() { 
    
/* Creates the list of letters and makes them a link. */ 
    
global $sortby$module_name
        
$alphabet = array ("All""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","Other"); 
        
$num count($alphabet) - 1
        echo 
"<center>[ "
    
/* start of HTML */ 
        
$counter 0
        while (list(, 
$ltr) = each($alphabet)) { 
            echo 
"<A HREF="modules.php?name=$module_name&amp;letter=$ltr&amp;sortby=$sortby">$ltr</a>"
            if ( 
$counter == round($num/2) ) { 
                echo 
" ]n<br>n[ "
            } elseif ( 
$counter != $num ) { 
                echo 
"&nbsp;|&nbsp;n"
            } 
            
$counter  
        } 
        echo 
" ]n</center>n<br>n";  // end of HTML 


function 
SortLinks($letter) {  // Makes order by links.. 
        
global $sortby$module_name
        if (
$letter == "front") { 
        
$letter "All"
    } 
        echo 
"n<center>n"// Start of HTML 
        
echo ""._SORTBY." <b>[</b> "
        if (
$sortby == "username" OR !$sortby) { 
            echo 
""._MNICKNAME."&nbsp;|&nbsp;"
        } else { 
            echo 
"<A HREF="modules.php?name=$module_name&amp;letter=$letter&amp;sortby=username">"._MNICKNAME."</a>&nbsp;|&nbsp;"
        } 
        if (
$sortby == "name") { 
            echo 
""._MREALNAME."&nbsp;|&nbsp;"
        } else { 
            echo 
"<A HREF="modules.php?name=$module_name&amp;letter=$letter&amp;sortby=name">"._MREALNAME."</a>&nbsp;|&nbsp;"
        } 
        if (
$sortby == "femail") { 
            echo 
""._MEMAIL."&nbsp;|&nbsp;"
        } else { 
            echo 
"<A HREF="modules.php?name=$module_name&amp;letter=$letter&amp;sortby=femail">"._MEMAIL."</a>&nbsp;|&nbsp;"
        } 
        if (
$sortby == "user_website") { 
            echo 
""._MURL."&nbsp;|&nbsp;"
        } else { 
            echo 
"<A HREF="modules.php?name=$module_name&amp;letter=$letter&amp;sortby=user_website">"._MURL."</a>"
        } 
        echo 
" <b>]</b>n</center>n"// end of HTML 


include(
"header.php"); 
$pagesize 20

if (!isset(
$letter)) { $letter "A"; } 
if (!isset(
$sortby)) { $sortby "username"; } 
if (!isset(
$page)) { $page 1; } 

/* All of the code from here to around line 125 will be optimized a little later */ 
/* This is the header section that displays the last registered and who's logged in and whatnot */ 

$result sql_query("select username from ".$user_prefix."_users order by user_id DESC limit 0,1"$dbi); 
list(
$lastuser) = sql_fetch_row($result$dbi); 
echo 
"nn<!-- MEMBERS LIST -->nn"
    
OpenTable(); 
        echo 
"<center><b>"._WELCOMETO.$sitename "._MEMBERSLIST."</b><br><br>n"
        echo 
""._GREETINGS." <A HREF="modules.php?name=Your_Account&amp;op=userinfo&amp;username=$lastuser">$lastuser</a>n</center>n<br>n"

        
$numrows sql_num_rows(sql_query("select user_id from ".$user_prefix."_users"$dbi), $dbi); 

        if (
is_user($user)) { 
            
$result2 sql_query("SELECT uname,guest FROM ".$prefix."_session where guest=0"$dbi); 
            
$member_online_num sql_num_rows($result2$dbi); 
        
$who_online "<b>"._ONLINEREG." </b><br><br>"
            
$i 1
            while (
$session sql_fetch_array($result2$dbi)) { 
                if (isset(
$session["guest"]) and $session["guest"] == 0) { 
                    
$who_online .= "<A HREF="modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]">$session[uname]</a>n"
                    
$who_online .= ($i != $member_online_num " - " ""); 
                    
$i  
                } 
            } 
            echo 
"<center>"._WEHAVE." <b>$numrows</b> "._MREGISTERED." <b>$member_online_num</b>n"
            echo 
" "._MREGONLINE."</center><br><br>"
        
OpenTable2(); 
            echo 
"<CENTER>$who_online</CENTER>n"
        
CloseTable2(); 
        echo 
"<br><br>"
        } else { 
            echo 
"<center>"._WEHAVE." <b>$numrows</b> "._REGSOFAR."</center>n<br>n<br>n"
        } 

        
alpha(); 
        
SortLinks($letter); 

/* end of top memberlist section thingie */ 
/* This starts the beef...*/ 

        
$min $pagesize * ($page 1); // This is where we start our record set from 
        
$max $pagesize// This is how many rows to select 

        /* All my SQL stuff. DO NOT ALTER ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING */ 

/* This is a totaly crap code, any help to re-code this functions will be very appreciated */ 
/* Need to be database independent */ 

        
$count "SELECT COUNT(user_id) AS total FROM ".$user_prefix."_users "// Count all the users in the db.. 
        
$select "select user_id, name, username, femail, user_website from ".$user_prefix."_users "//select our data 
    
$where "where username != 'Anonymous' "
    if ( ( 
$letter != "Other" ) AND ( $letter != "All" ) ) {  // are we listing all or "other" ? 
            
$where .= "AND username like '".$letter."%' "// I guess we are not.. 
        
} else if ( ( $letter == "Other" ) AND ( $letter != "All" ) ) { // But other is numbers ? 
            
$where .= "AND username REGEXP "^[1-9]" "// REGEX :D, although i think its MySQL only 
                                                        // Will have to change this later. 
                                                        // if you know a better way to match only the first char 
                                                        // to be a number in uname, please change it and email 
                                                        // myphportal-developers@lists.sourceforge.net the correction 
                                                        // or goto http://sourceforge.net/projects/myphportal and post 
                                                        // your correction there. Thanks, Bjorn. 
        
} else { // or we are unknown or all.. 
            
$where .= ""// this is to get rid of anoying "undefinied variable" message 
        

        
$sort "order by $sortby"//sorty by ..... 
        
$limit " ASC LIMIT ".$min.", ".$max// we only want rows $min  to $max 
        /* due to how this works, i need the total number of users per 
        letter group, then we can hack of the ones we want to view */ 
        
$count_result sql_query($count.$where$dbi); 
        
$num_rows_per_order mysql_result($count_result,0,0); 

        
/* This is where we get our limit'd result set. */ 
        
$result sql_query($select.$where.$sort.$limit$dbi) or die(); // Now lets do it !! 

/* Crap code ends here */ 

        
echo "<br>"
        if ( 
$letter != "front" ) { 
            echo 
"<table width="1" border="0" cellspacing="1"><tr>n"
            echo 
"<td BGCOLOR="$bgcolor4" align="center"><font color="$textcolor2"><b>"._NICKNAME."</b></font></td>n"
            echo 
"<td BGCOLOR="$bgcolor4" align="center"><font color="$textcolor2"><b>"._REALNAME."</b></font></td>n"
            echo 
"<td BGCOLOR="$bgcolor4" align="center"><font color="$textcolor2"><b>"._EMAIL."</b></font></td>n"
            echo 
"<td BGCOLOR="$bgcolor4" align="center"><font color="$textcolor2"><b>"._URL."</b></font></td>n"
            
$cols 4
            if(
is_admin($admin)) { 
                
$cols 5
                echo 
"<td BGCOLOR="$bgcolor4" align="center"><font color="$textcolor2"><b>"._FUNCTIONS."</b></font></td>n"
            } 
            echo 
"</tr>"
            
$a 0
            
$dcolor_A "$bgcolor2"
            
$dcolor_B "$bgcolor1"


            
$num_users sql_num_rows($result$dbi); //number of users per sorted and limit query 
            
if ( $num_rows_per_order 0  ) { 
                while(
$user sql_fetch_array($result$dbi)) { 
                    
$dcolor = ($a == $dcolor_A $dcolor_B); 
                    echo 
"<tr><td bgcolor="$dcolor"><A HREF="modules.php?name=Your_Account&amp;op=userinfo&amp;username=$user[username]"><font color="$textcolor1">$user[username]</font></a>&nbsp;</td>n"
                    echo 
"<td bgcolor="$dcolor"><font color="$textcolor1">$user[name]</font>&nbsp;</td>n"
                    echo 
"<td bgcolor="$dcolor"><font color="$textcolor1">$user[femail]</font>&nbsp;</td>n"
                    if (
$user[user_website] == "") { 
            
$url2 "&nbsp;"
            } else { 
            
$urlno eregi_replace("http://","",$user[user_website]); 
            
$url2 "<a href="http://$urlno" target="new">"._HOMEPAGE."</a>"; 
            

            echo 
"<td bgcolor="$dcolor" align="center">$url2</td>n"
                    if(
is_admin($admin)) { 
                        echo 
"<td bgcolor=$dcolor align=center><font class="content" color="$textcolor1">[ <A HREF="modules.php?name=Your_Account&file=admin&op=modifyUser&chng_uid=$user[user_id]">"._EDIT."</a> | n"
                        echo 
"<A HREF="modules.php?name=Your_Account&file=admin&op=deleteUser&chng_uid=$user[user_id]">"._DELETE."</a> ]</font></td>n"
                    } 
                    echo 
"</tr>"
                    
$a = ($dcolor == $dcolor_A 0); 
                } 
                
// start of next/prev/row links. 
                
echo "n<tr><td colspan='$cols' align='right'>n"
        echo 
"<br><br>"
        
OpenTable(); 
                echo 
"t<table width='1' cellspacing='0' cellpadding='0' border=0><tr>"

                if ( 
$num_rows_per_order $pagesize ) { 
                    
$total_pages ceil($num_rows_per_order $pagesize); // How many pages are we dealing with here ?? 
                    
$prev_page $page 1

                    if ( 
$prev_page ) { 
                        echo 
"<td align='left' width='Q'><a href='modules.php?name=$module_name&amp;letter=$letter&amp;sortby=$sortby&amp;page=$prev_page'>"
                        echo 
"<img src="images/left.gif" border="0" alt=""._PREVIOUS." ($prev_page)" title=""._PREVIOUS." ($prev_page)"></a></td>"
                    } else { 
                        echo 
"<td width='Q'>&nbsp;</td>n"
                    } 

                    echo 
"<td align='center' width=''>"
                    echo 
"<font class=tiny>$num_rows_per_order "._USERSFOUND." <b>$letter</b> ($total_pages "._PAGES.", $num_users "._USERSSHOWN.")</font>"
                    echo 
"</td>"

                    
$next_page $page   1
                    if ( 
$next_page <= $total_pages ) { 
                        echo 
"<td align='right' width='Q'><a href='modules.php?name=$module_name&amp;letter=$letter&amp;sortby=$sortby&amp;page=$next_page'>"
                        echo 
"<img src="images/right.gif" border="0" alt="Next Page ($next_page)" title="Next Page ($next_page)"></a></td>"
                    } else { 
                        echo 
"<td width='Q'>&nbsp;</td></tr>n"
                    } 
    
/* Added a numbered page list, only shows up to 50 pages. */ 

                        
echo "<tr><td colspan="3" align="center">"
                        echo 
" <font class=tiny>[ </font>"

                        for(
$n=1$n $total_pages$n  ) { 


                            if (
$n == $page) { 
                echo 
"<font class=tiny><b>$n</b></font></a>"
                            } else { 
                echo 
"<a href='modules.php?name=$module_name&amp;letter=$letter&amp;sortby=$sortby&amp;page=$n'>"
                echo 
"<font class=tiny>$n</font></a>"
                } 
                            if(
$n >= 50) {  // if more than 50 pages are required, break it at 50. 
                                
$break true
                                break; 
                            } else {  
// guess not. 
                                
echo "<font class=tiny> | </font>"
                            } 
                        } 

                        if(!isset(
$break)) { // are we sopposed to break ? 
                
if ($n == $page) { 
                            echo 
"<font class=tiny><b>$n</b></font></a>"
                } else { 
                            echo 
"<a href='modules.php?name=$module_name&amp;letter=$letter&amp;sortby=$sortby&amp;page=$total_pages'>"
                            echo 
"<font class=tiny>$n</font></a>"
                } 
                        } 
                        echo 
" <font class=tiny>]</font> "
                        echo 
"</td></tr>"

    
/* This is where it ends */ 
                
}else{  // or we dont have any users.. 
                    
echo "<td align='center'>"
                    echo 
"<font class=tiny>$num_rows_per_order "._USERSFOUND.$letter</font>"
                    echo 
"</td></tr>"

                 } 

                 echo 
"</table>n"
         
CloseTable(); 
                echo 
"</td></tr>n"

                 
// end of next/prev/row links 

            
} else { // you have no members on this letter, hahaha 
                
echo "<tr><td bgcolor="$dcolor_A" colspan="$cols" align="center"><br>n"
                echo 
"<b><font color="$textcolor1">"._NOMEMBERS.$letter</font></b>n"
                echo 
"<br></td></tr>n"
            } 

            echo 
"n</table><br>n"
        } 

    
CloseTable(); 
        include(
"footer.php"); 

?>



507
tzvook
Alphabetic Order still nothing in the air
  • 2005/3/18 9:37

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Since it's not a fix for the alpha problem, I wonder if anybody saw an alphabetic sorting panel that actually works in Xoops, or knows how to find the first letter in MySql field ...

I need it badly, and no answere yet ..... though I read and read MySql & PHP manuals



508
tzvook
Re: Attach file in news modules over 2.0.9.2
  • 2005/3/10 15:32

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Since nobody noticed Hervert question (which is the answere too ) I'll answere:

The news uploader is using class/uploader.php so mime types for the files uploaded needs to be defined (the defaults are jpg, png, gif, pdf zir, tar jtar (open file news/submit.php and look for (round line 326)

$permittedtypes=array('image/gif''image/jpeg''image/pjpeg''image/x-png''image/png' ,'application/x-zip-compressed''application/pdf''application/x-gtar''application/x-tar');


If you want your users to be able to attach some more file types, add those as changed here (WORD and EXCELL addition):

$permittedtypes=array('image/gif''image/jpeg''image/pjpeg''image/x-png''image/png' ,'application/x-zip-compressed''application/pdf''application/x-gtar''application/msexcel''application/msword''application/x-tar');


Some popular mime types to choose from:

application/pdf => PDF Document
image/x-png => PNG Image
video/vivo => VIVO Movie
application/x-compress => Compressed Zip File
video/x-msvideo => MS Video
text/html => HTML Page
audio/x-pn-realaudio => Real Audio File
image/gif => GIF Image
video/mpeg => MPEG Video'
image/ico => Icon Files
application/x-tar => TAR Ball
image/x-MS-bmp => BMP Image
image/tiff => TIFF Image
text/richtext => Rich Text
audio/x-realaudio => Real Audio
application/mac-binhex40 => Mac Binary
audio/x-aiff => AIFF File
application/x-gzip => GZIP File
application/zip => ZIP File
application/postscript => Postscript
application/msword => MS Word doc
application/msexcel => Excel File
application/vnd.msexcel => Excel File
video/quicktime => QuickTime Movie
application/powerpoint => PowerPoint Doc
audio/x-wav => WAV File
audio/x-mpeg => MPEG Audio
image/jpeg => JPEG Image
application/x-zip-compressed => ZIP File
application/octet-stream => OCTET Stream
text/plain => Text File
image/pjpeg => JPEG Image

Was tested under both winXp Linux and FreeBSD, XOOPS 2.092 with uploader.php 1.6

Hope this will answere your question
Just be awareof the risk in letting your users upload a "Virus anabled kinda files



509
tzvook
Re: [myEDITO] A user homepage version for test
  • 2005/3/9 11:21

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:
solo71 wrote:
Test time now !


Yep, just writing a few ideas b4 they will be lost:

main module page shows authors list, which is not enough, due to the fact that "Homepages" may be for groups or if not groups, for a "sublect", not for a "user".
so it might be a good idea to give an admin option like:
"details in user myedito page"
- 1. user's info
- 2. user's first edito subject & picture
- 3. custom info & picture
- 4. ............



510
tzvook
Re: Alphabetical Order Bugfix
  • 2005/3/9 10:45

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

Wheeler wrote:
tzvook,
from recent threads, I am aware you have a hacked version of xdir. I also thought I read somewhere your alpha links hack came from WF-Downloads. Sorry, I guess I can not help you. This is beyond the focus of the work which I'm currently conducting.


No problem Wheeler, but it's not about the XDIR (or the hacked version) ... it's about the "alphabetic links hack" which I thought might be connected to a lot of modules for Alpha sorting if needed.... due to the ease that it can be connected (when fixed).

Actually, I need the hack for the MyEdito module, I linked the Xdir just for alpha-menu test purpose.

Quite funny was for me to find out that all the phonebooks are without an Alphabetic sorting (simply useless) or the business directories (Xdir and so..) That's why I try to find something that'll fit all modules or at least quite a few, hope someone will help.

I'm still trying to find the problem, though quite lost with it... If somebody knows about an Alphabetic menu for sorting the database, please post here...




TopTop
« 1 ... 48 49 50 (51) 52 53 54 ... 60 »



Login

Who's Online

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


Members: 0


Guests: 154


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