Webmastersite.net
Register Log In

toplist filter by value from an array
will this be in 4.2?

Comments on toplist filter by value from an array

david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jun 10, 2008 - 3:26 PM:

Hi Paul,

I have a feeling I ran into the same issue as before in this old post: www.webmastersite.net/forum...orums/comments.php?id=7730

I have a member field, and I got a multiselect dropdown I use for creating it's values. so the values in the DB look like: , 32, 33 and the field can be nicely edited.

BUT I cannot display it's contents. All I get is 'yes'.

I wanted to use it in a toplist, like this:


<!-- BEGIN TOPLIST 28 -->
<CONFIG>members,id,5,ascending,latta OR ', 31',,,0,0,0,0,0,0,,0</CONFIG>
{MEMBERLATTA}
<!-- END TOPLIST 28 -->


and all i get is:

Load time so far: 0.05 seconds.



Query 2: SELECT `name`,`value` FROM wsnlinks_switches WHERE id>0

Number of rows is 93

Load time so far: 0.05 seconds.



Query 3: SELECT `id`,`type`,`original`,`replacement`,`description`,`originalclose`,`replacementclose`,`sortorder` FROM wsnlinks_markup WHERE type='wsncode' ORDER BY sortorder

Number of rows is 26

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Creating markup with Array as row

Load time so far: 0.05 seconds.



Query 4: SELECT `id`,`title`,`caneditown`,`caneditall`,`canvote`,`isadmin`,`canpost`,`canemail`,`validatecats`,`validatecomments`,`validatelinks`,`validateedits`,`cansubmitlinks`,`cansubmitcategories`,`cansubmitcomments`,`caneditownlinks`,`caneditowncategories`,`caneditowncomments`,`caneditownprofile`,`caneditalllinks`,`caneditallcategories`,`caneditallcomments`,`caneditallprofiles`,`candownloadfiles`,`canupload`,`canviewip`,`limitlinks`,`canemailmembers`,`canusehtml`,`limitlinksdaily`,`canalias`,`cancopy`,`candeleteown`,`candeleteall`,`candofulledit`,`candeletecategories`,`candeletecomments`,`candeleteowncategories`,`candeleteowncomments`,`candeletemembers`,`candeleteownmembers`,`canaliascategories`,`canviewpages`,`caneditvotes`,`numaliases`,`canviewvotes`,`canhideownlinks`,`canhideowncategories`,`canhideowncomments`,`canhidealllinks`,`canhideallcategories`,`canhideallcomments`,`canratecomments`,`bytespermem`,`canpm`,`canim`,`canharddelete`,`limitpms`,`limitpmsdaily`,`canviewdeleted`,`cansubmitpolls`,`candeletepolls`,`candeleteownpolls`,`caneditpolls`,`caneditownpolls`,`attachperpost`,`attachperpm`,`canviewshouts`,`caneditshouts`,`caneditownshouts`,`candeleteshouts`,`candeleteownshouts`,`cansubmitshouts`,`canpollvote`,`customtitle`,`canviewinvisible`,`namestyle`,`canpmimportant`,`canviewmodlog`,`isleader`,`cansubmitquotes`,`validatequotes`,`candeletequotes`,`candeleteownquotes`,`canreport`,`canusesearch`,`attachperlink`,`validateattachments`,`caneditownquotes`,`caneditallquotes`,`canviewchat`,`caneditownevents`,`caneditallevents`,`candeleteownevents`,`candeleteevents`,`cansubmitevents`,`validateevents`,`bulkpms`,`issupermod`,`numinv`,`allowugspec`,`validateemails`,`validatesponsorlinks`,`cansubmittags`,`candeletetags`,`cansubmitfeeds`,`validatefeeds`,`validatefeeditems`,`numaliasestot`,`shoutsperday`,`validatetrader`,`renewdays`,`renewtimes`,`canviewownfulltrc`,`canviewallfulltrc` FROM wsnlinks_membergroups WHERE id>0

Load time so far: 0.06 seconds.



Query 5: SELECT `id`,`name`,`links`,`comments`,`time`,`usergroup`,`password`,`ip`,`totalhits`,`totalhitsin`,`email`,`validated`,`template`,`language`,`lastattempt`,`allowemail`,`signature`,`avatarname`,`stylesheet`,`allowuseremail`,`albumid`,`failedattempts`,`totalbytes`,`funds`,`notifyoflinks`,`lastvisit`,`timezone`,`rating`,`pmfolders`,`notifyofpms`,`acceptpms`,`cookieduration`,`banned`,`location`,`homepage`,`occupation`,`bio`,`aim`,`icq`,`msn`,`yahoo`,`inactive`,`timeonline`,`totalpms`,`buddies`,`ignored`,`isonline`,`acceptims`,`adminpermissions`,`referrer`,`groupreverttime`,`grouprevertto`,`moderationpm`,`secondarygroups`,`linksperpage`,`commentsperpage`,`shouts`,`customtitle`,`shoutban`,`topicbans`,`forumbans`,`visibility`,`birthdate`,`lastsession`,`interests`,`posteditor`,`forumaccess`,`pmpopup`,`pmnotify`,`modnotes`,`guestnotes`,`salt`,`lastmodnote`,`newpms`,`imflag`,`orderalbums`,`lastguestnote`,`autosubscribe`,`notifymethod`,`showavatars`,`showsigs`,`warninglevel`,`topics`,`posts`,`chatcolor`,`traderrating`,`invitessent`,`validatedemail`,`calsub`,`macros`,`guestnotify`,`keychecktime`,`notifykeywords`,`autosubscribepost`,`blogrss`,`positivepct`,`notifytrader`,`helyseg`,`minar`,`maxar`,`varos`,`epitoanyag`,`minalapterulet`,`maxalapterulet`,`minkertmeret`,`maxkertmeret`,`minepiteseve`,`maxepiteseve`,`minszobaszam`,`maxszobaszam`,`minfelszobaszam`,`maxfelszobaszam`,`erkely`,`franciaerkely`,`galeria`,`futes`,`kilatas`,`tajolas`,`komfort`,`lift`,`minemeleten`,`maxemeleten`,`parkolas`,`parkolasautok`,`lakasallapot`,`epuletallapot`,`extrak`,`butorozott`,`minemeletek`,`maxemeletek`,`kiadoelado`,`milyenar`,`telefon`,`kategoria`,`latta` FROM wsnlinks_members WHERE id='1' AND validated=1

Load time so far: 0.08 seconds.



Query 6: SELECT `id`,`to`,`subject`,`message`,`headers`,`replacement`,`mime` FROM wsnlinks_email WHERE timesent=0 ORDER BY id ASC LIMIT 0,10

Number of rows is 0

Load time so far: 0.1 seconds.



Query 7: SELECT `catid` FROM wsnlinks_sessions WHERE catid>0 AND time > 1213128435

Number of rows is 0

Load time so far: 0.1 seconds.



Query 8: UPDATE wsnlinks_categories SET numonline='0' WHERE 1=1

Load time so far: 0.1 seconds.



Query 9: SELECT `id`,`frequency`,`filename`,`nextrun` FROM wsnlinks_crons WHERE nextrun < 1213129335 ORDER BY id ASC LIMIT 0,1

Number of rows is 0

Load time so far: 0.11 seconds.



Query 10: SELECT COUNT(id) FROM wsnlinks_categories WHERE parent=0 AND deleted=0 AND hide=0 AND isalbum=0 AND validated=1

Count is 1

Load time so far: 0.11 seconds.



Query 11: SELECT `id`,`name`,`parent`,`validated`,`description`,`time`,`parentnames`,`parentids`,`numlinks`,`hide`,`lastlinktime`,`custom`,`lastedit`,`moderators`,`headerinfo`,`related`,`numsub`,`type`,`permissions`,`subscribers`,`mixtypes`,`isalbum`,`orderlinks`,`totalcomments`,`ulsearchmax`,`ulsearchquery`,`ulsearchadult`,`alias`,`catcols`,`linkcols`,`dmozpath`,`sponsorlinks`,`views`,`customwrap`,`deleted`,`reqlinks`,`reqcoms`,`reqlinksdelay`,`priority`,`levelsdeep`,`lastposterid`,`lastpostername`,`lastcommenttime`,`lastthreadid`,`lastthreadtitle`,`linkshere`,`unvalidatedlinks`,`unvalidatedcomments`,`actaslink`,`countposts`,`subcatshtml`,`linksperpage`,`wysihtml`,`numonline`,`sponsorship`,`lastprofileurl`,`defaultnoaccess`,`lastthreadurl`,`lastposturl` FROM wsnlinks_categories WHERE parent=0 AND validated=1 AND hide=0 AND isalbum=0 AND deleted=0 ORDER BY priority ASC,name ASC LIMIT 0,40

Number of rows is 1

Creating category with Array as row

Load time so far: 0.12 seconds.



Query 12: SELECT `id`,`name`,`links`,`comments`,`time`,`usergroup`,`password`,`ip`,`totalhits`,`totalhitsin`,`email`,`validated`,`template`,`language`,`lastattempt`,`allowemail`,`signature`,`avatarname`,`stylesheet`,`allowuseremail`,`albumid`,`failedattempts`,`totalbytes`,`funds`,`notifyoflinks`,`lastvisit`,`timezone`,`rating`,`pmfolders`,`notifyofpms`,`acceptpms`,`cookieduration`,`banned`,`location`,`homepage`,`occupation`,`bio`,`aim`,`icq`,`msn`,`yahoo`,`inactive`,`timeonline`,`totalpms`,`buddies`,`ignored`,`isonline`,`acceptims`,`adminpermissions`,`referrer`,`groupreverttime`,`grouprevertto`,`moderationpm`,`secondarygroups`,`linksperpage`,`commentsperpage`,`shouts`,`customtitle`,`shoutban`,`topicbans`,`forumbans`,`visibility`,`birthdate`,`lastsession`,`interests`,`posteditor`,`forumaccess`,`pmpopup`,`pmnotify`,`modnotes`,`guestnotes`,`salt`,`lastmodnote`,`newpms`,`imflag`,`orderalbums`,`lastguestnote`,`autosubscribe`,`notifymethod`,`showavatars`,`showsigs`,`warninglevel`,`topics`,`posts`,`chatcolor`,`traderrating`,`invitessent`,`validatedemail`,`calsub`,`macros`,`guestnotify`,`keychecktime`,`notifykeywords`,`autosubscribepost`,`blogrss`,`positivepct`,`notifytrader`,`helyseg`,`minar`,`maxar`,`varos`,`epitoanyag`,`minalapterulet`,`maxalapterulet`,`minkertmeret`,`maxkertmeret`,`minepiteseve`,`maxepiteseve`,`minszobaszam`,`maxszobaszam`,`minfelszobaszam`,`maxfelszobaszam`,`erkely`,`franciaerkely`,`galeria`,`futes`,`kilatas`,`tajolas`,`komfort`,`lift`,`minemeleten`,`maxemeleten`,`parkolas`,`parkolasautok`,`lakasallapot`,`epuletallapot`,`extrak`,`butorozott`,`minemeletek`,`maxemeletek`,`kiadoelado`,`milyenar`,`telefon`,`kategoria`,`latta` FROM wsnlinks_members WHERE 1=1 AND (latta OR ', 31') ORDER BY id ASC LIMIT 0,5

Number of rows is 0

Load time so far: 0.12 seconds.



Query 13: SELECT `id`,`memberid`,`location`,`time`,`ip`,`browser`,`starttime`,`catid`,`threadid`,`areaname`,`lastsearch`,`nopermission`,`inchat`,`name`,`isrobot`,`lastchat`,`groupnamestyle`,`acceptims`,`visibility`,`profileurl` FROM wsnlinks_sessions WHERE memberid=1

Number of rows is 1

Creating online with Array as row

Load time so far: 0.12 seconds.



Query 14: UPDATE wsnlinks_sessions SET starttime='1213117840', time='1213129335', location='http://xxx.com/index.php?usewrapper=no&custom=yes&TID=membersonlinks', catid='0', threadid='', areaname='Main', nopermission='0', inchat='0', ip='78.92.0.250' WHERE id=40

14 total queries
This page was created in 0.12 seconds
Memory used: 4690648 bytes
Server Status: time since last reboot is 26 days, 16:17, load average: 6.28, 5.76, 5.00



Of course, if I remove the filter in the toplist, then I get a 'yes' for all the members who have any value in this MEMBERLATTA field.


So is this something I just messed up, or this is that feature that hasn't been implemented yet?

Thanks
David
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 10, 2008 - 7:29 PM:

Your synatax is logically incoherent. You wrote:
latta OR ', 31'

"OR", like "AND", only makes sense for joining mutliple different tests. "OR" cannot be a comparison operator itself, so the above is true as long as the universe continues to exist to give , 31 a non-zero value. What do you want to do with "latta" and what to do you want to do with ', 31'? That needs to be specified. If, say, you want to find where latta is equal to ', 31' you use latta = ', 31'. Except that'd never be the case, so more likely you'd want to find where latta contains 31: latta LIKE '%|31|%'
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jun 11, 2008 - 2:06 AM:

oopss. the LIKE '%, 31%' works. thanks Paul. smiling face

However, the {MEMBERLATTA} still gives me 'yes' and not it's contents like ', 31'.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jun 11, 2008 - 2:43 AM:

How about php string here, that retrives that LATTA information for this member from the db, and displays it? Would that work?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 12, 2008 - 5:46 AM:

31 doesn't work properly, as I explained above, unless you never get more than 309 categories. There's no reason to build in a time bomb.

Why would you ever want to display something like , 89, 4234, 132, to visitors? It's not exactly user friendly so I don't have a mechanism for it.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jun 12, 2008 - 6:19 AM:

This would be displayed for the admin only. Each member profile will have this field called LATTA. This field should hold multiple values of text (don't mind that it is a number right now). I want to create a toplist that list the members, and applies this kind of filter: latta LIKE ', 31text' .

Once it finds that single/multiple members who have this value in their LATTA profile field (amongst the multiple values of that field), it should display the value of that field, FILTERED to the particular ', 31text' value, for each member in the toplist.
Like this:


<!-- BEGIN TOPLIST -->
<CONFIG>members,id,5,ascending,latta LIKE ', 31text',,,0,0,0,0,0,0,,0</CONFIG>
<IF {MEMBERCHECKED[latta <,> 31text]}>31text<OTHERWISE> </IF>
<!-- END TOPLIST -->



See what I mean? So I was thinking, if this was possible perhaps with some php?

Thanks
David
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jun 12, 2008 - 7:16 PM:

Hi Paul,

I think I figured it out. smiling face I'll let you know if the solution I found is working.

Cheers
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jun 20, 2008 - 11:45 AM:

Hi Paul,

Ok, forgetting the toplist for a second...

Is there a way to display the values of a link field that contains multiple values? I know that {LINKWHATEVERTHEMULTIPLEVALUEFIELDIS} would give me a 'yes' right now. So I have to do the usual
<IF {LINKCHECKED[whateverthemultiplevaluefieldis <,> firstvalue]}>firstvalue</IF>
<IF {LINKCHECKED[whateverthemultiplevaluefieldis <,> secondvalue]}>secondvalue</IF>
to display each value. Have there been changes to WSNLINKS that deals with this problem?

If I do the above solution, I'd get each value, right after each other. How can I put at least a comma between them? Will there be ever a way to just simply say {LINKWHATEVERTHEMULTIPLEVALUEFIELDIS} and it outputs: firstvalue, secondvalue....etc.??

Is there any php magic that would perhaps read , firstvalue, secondvalue and before displaying it, change the , to a comma?

Thanks Paul
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jun 20, 2008 - 5:00 PM:

{FUNC_SHOWFIELDVALUE[type <,> number <,> field]}

I found this in the manual. smiling face So now I need to figure out how to change the , values to a comma.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
#10 - Quote - Permalink
Posted Jun 20, 2008 - 6:00 PM:

<?php
$fieldvalues = str_replace(", ", ", ", "{FUNC_SHOWFIELDVALUE[link <,> {LINKID} <,> helyseg]}");
$str = "$fieldvalues";
$r = substr($str, 2,999);
echo $r;
?>

Got it. smiling face
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.