Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
In 2-3 weeks I want to launch a new shopping cart for my site, along with a means of reselling storefront & shopping cart services to my community from mywebsitetools.com service pkg. Ubb.c 6.7.2 - www.dragboatalley.com

To integrate these new services with my existing site, I want to a add a "Shops Index" script that's tied into to my standard tabs menu. So I swooped a copy of AA's [6.7] [beta] ubb.index v1.5 and laid out the main index page to look like the games mod

http://dragboatalley.com/cgi-bin/dbashops.cgi

Ultimately, i got 2 types of "shops" to show up in here, with shop name & thumbnail image that links to a storefront (product list) page either embedded on my site, hosted on the service provider's site, or some other site. ( Demo Storefront )

So I'm looking for help to finish this script while I finish setting up the storefronts & informational portal pages that go with 'em. I need someone to do the real work of hooking this shell script up to a data file for the following requirements:

  • Add an admin-only page where i can view/add/edit/delete the list of shops
  • Data file fields include: unique id, shop type (0 || 1), shop name, shop URL, image filename (thumb), activated/deactivated flag
  • finish the main page to spin off the display of shops (just like games mod but using data file). Shops get listed in each column based on shop type field (0 = left column, 1 = right). plus handle multiple pages & only show me the 'activated' shops
  • and sprinkle in a few wordlets for ease of long life cosmetics; Page Title, 2 Column Titles (shop types), location on disk of "shops" directory where thumbnail images be kept, etc.

Here's the shell script i put together so far:
http://dragboatalley.com/shops/dbashops.txt

Let me know if you have any questions, or contact me by PM or email to boards @ dragboatalley.com w/ price quote on the job if your interested. And fwiw - I'm more than happy to play test/debug/polisher monkey here if someone just wants to whip up a down 'n dirty quickie blind stab at this. Tks!

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Didya get any takers? It's been a while since most of us have looked at any perl code smile


- Allen wavey
- What Drives You?
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
nada (sigh) but i knew i was fishing a near empty pond before i posted this, but i hate perl so intensively figured it was worth a shot smile

Meanwhile i did fiddle this abit myself and got the main shops index / shopping mall page to halfway work:

http://dragboatalley.com/cgi-bin/dbashops2.cgi

and showing folks on my site a sneak peak of this has already sold me a couple of shopping carts. So I guess I aint got no choice but to finish it myself frown can you move this topic to the new members forum for me? cuz there's a whole waft of perl idgit questions coming soonly.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
hehe smile It's looking good already. I'll move this there now and just ask when you run across something smile


- Allen wavey
- What Drives You?
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
Ok I'm totally stuck on handling multiple pages, and this is all i need to finish my sub showmain that does the shopping mall main index.

I have $page var and $totpages var that tell me current page number to display and the total pages in the index.
plus I have a $shopcolcnt var for the number of shops per column. then I get to follow bit that parses the datafile

Code

# one datafile how da heck to split it into pages
@datafile = &OpenFileAsArray("$vars_config{NonCGIPath}/shops/shoplist.cgi");

foreach $thisline(@datafile) {
chomp($thisline);
if ($thisline ne '') {
@linearray = split(/\|\|/,$thisline);
##output it if active shop
if ($linearray[6]=1) {
## weed out shop type for each column
if ($linearray[1] == "0") {
# we have a pit shop
$pshops .= "<br><b><a href=\"$linearray[3]\">$linearray[2]</a></b><br>\n";
$pshops .= "<br><a href=\"$linearray[3]\"><img src=\"http://dragboatalley.com/shops/$linearray[4]\" border=\"1\" alt=\"Click Here to visit this Shop\"</a><br><br><br>\n";
} else {
# we have a featured shop
$fshops .= "<br><b><a target=\"_blank\" href=\"$linearray[3]\">$linearray[2]</a></b><br>\n";
$fshops .= "<br><a target=\"_blank\" href=\"$linearray[3]\"><img src=\"http://dragboatalley.com/shops/$linearray[4]\" border=\"1\" alt=\"Click Here to visit this Shop\"</a><br><br><br>\n";
}
}
}
}

as-is, it dumps all shops on one page not matter what page requested. The only thing i did with the page handling vars was page number links at bottom of index.

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
I believe Ian (and LK and Burak smile ) helped me with a pagination routine in the links script, you might check that out smile


- Allen wavey
- What Drives You?
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
i dont think it's in the links script, but there's pagination in games mods. But the logic is different in those than what i need cuz it loops thru a directory list of files instead of spinning thru a data file. frown

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
ok i got past the above dilema by flat out cheating,
and just setup one datafile per page.

last two hurdles will be wordlets for all my
hardcoded stuff, and admin ability to add/edit
the list shops in a given data file.

anything i need know about settting up a
vars_wordlets_shops.cgi? if i do it just like other mods,
will it automatically appear in control panel for me? TIA!


Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
yes, you might check out the vars_wordlets_mods modification - it will give you all the inside stuff to get your new file to appear in the cp smile


- Allen wavey
- What Drives You?
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
ok does this look right?

Code

%vars_wordlets_shops = (
q!shops_datafileprefix! => q!/shops/!,
q!shops_pages! => 1,
);
1;

I need the second var to be a number... do i store it like this, or still wrapped in q!! syntax? tks!!!!

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
You'll need to wrap the numbers, but yes, that's how you do it smile


- Allen wavey
- What Drives You?
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
thank you Allen for all your help, I'm nearly finished! Only
major thing i have left is save handling on add new shop record
to a datafile.

But since I took the easy way out and split stuff into multiple
datafiles for each page in my shopping mall index, and I control
the number of pages in the index with a var in my wordlets
file... I'm wondering how hard it is to have an html form
where admin user can change the number of pages and update the wordlet var?

I've been digging for an example somewhere of how
to write out an update to a wordlet value but struck out frown

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
scratch last question, i just moved page count var to it's own datafile and made life easier smile

good grief - i'm finally done! thanks again for your help Allen

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
I didn't do much, but you are welcome smile


- Allen wavey
- What Drives You?

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)