[ic] user-dependent products.txt

interchange-users@lists.akopia.com interchange-users@lists.akopia.com
Tue May 15 19:34:01 2001


On Wed, May 16, 2001 at 12:10:28AM +0200, alasdair@gmx.net wrote:
> hi list
> 
> here?s a problem that has me stumped but someone else could possibly (and
> hopefully) solve with a quick glance.
> 
> I have a pulldown menu generated from the area.txt which retrieves the data
> from the products.txt.. but to complicate things :) we would like to specify
> a set list of products dependent on who the user is logged in as... 
> eg. we have a products.txt with 100 articles.. all of which are viewable by
> USERA but 50 viewable by USERB


Seems to me the key to this is your database schema and what
makes sense for that.  There are probably different solutions 
for n users with x products where n is large or n is very small.

One could do this in a generalized way with a usual products 
table and a second user_products table that consisted of only:

  id   product_code

Then do a JOIN on that table and the products table to build 
any queries.

cfm

> 
> here?s the pulldown:
> 
> <FORM NAME="myform">
> <SELECT NAME="dest" SIZE=1 ONCHANGE="leapto(this.form)">
> <option SELECTED value=""><font color=ffffff>Choose a product:</option>
> [loop search="
> 	fi=area.txt
> 	tf=sort
> 	ra=yes
> 	rf=code,name
> 	un=yes
> 
> 		sf=which_page
> 			op=rm
> 	[if scratch page_class]
> 		se=all|[scratch page_class][set page_class][/set]
> 	[else]
> 		se=all|@@MV_PAGE@@
> 	[/else]
> 	[/if]
> " prefix=box]
> <option value="[area 
> 		href=scan
> 		search='
> 		sf=category
> 		se=[box-code]
> 		va=category=[box-code]
> 		']">[box-param name]</option>
> [/loop]
> </select>
> </form>
> 
> the above code is in it?s own frame called menu.html which only gets
> accessed after the initial login!
> 
> So the bit i?m stumped at it..
> Do i specify in the login page which menu.html gets loaded dependent on
> who?s logged in?
> Or do i put a restriction in the pulldown menu with some kind of fancy if
> logged/then loop? 
> Or do i filter the return of ALL products in the results.html? 
> And lastly is what i?d like to do at all possible with minivend and if so
> then how?
> 
> any clues or hints much appreciated!
> 
> thanks,
> alasdair
> 
> 
> -- 
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
> 
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users

-- 

Christopher F. Miller, Publisher                             cfm@maine.com
MaineStreet Communications, Inc         208 Portland Road, Gray, ME  04039
1.207.657.5078                                       http://www.maine.com/
Content management, electronic commerce, internet integration, Debian linux