1
wcrwcr
MyAds - Last ads block
  • 2004/8/30 14:42

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hi all!!

I?m using this module on a test environment and the "Last Announces" block that appears in the mod?s index page, we have the following fields:

1. title
2. price
3. date
4. town/country
5. photo
6. hits

The point is:

in the town/country field the resulting word is showed without space, like for instance Los AngelesUSA.

I did a lot of search in the code and templates but all modifications didn?t work.

Looking in the template of the ""myads_adlist.html" file, I found that piece of code: <{$item.local}> but i can?t find where it "cames from".

Any help will be appreciated.
Regards


2
Temumot
Re: MyAds - Last ads block
  • 2004/8/30 15:19

  • Temumot

  • Just popping in

  • Posts: 9

  • Since: 2004/8/11


Hi wcrwcr,
What version of myAds do you use?
I think it cames from /include/functions.php
There are the line like

$xoopsTpl->append('items', $a_item);

Those ad data is set as $items.
and on the template, there is this line.

<{foreach item=item from=$items}>

after that, $items is called as item.

Town and country are appended in functions.php like this.

$a_item['local'] = '';
if ($town) {
$a_item['local'] .= $town;
}
if ($country) {
$a_item['local'] .= $country;
}

I think those data must be sent to template each.

Thank you,

Temumo

3
wcrwcr
Re: MyAds - Last ads block
  • 2004/8/30 15:45

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hi Temumo

Thanks for your reply!
I?m using the 2.0 version.

Any tip to put a " - " between the town and country?
Thanks!

4
ChadK
Re: MyAds - Last ads block
  • 2004/8/30 17:08

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


In myAds/include/functions.php
the section in function showNew that displays the town and country and modify it:
Quote:
if ($town)
$a_item['local'] .= $town;
if ($country)
$a_item['local'] .= $country;
if ($town && $country)
$a_item['local'] = "$town, $country";


This shows city or state if only one exist or it shows "city, state" if both exist.

5
ChadK
Re: MyAds - Last ads block
  • 2004/8/30 17:09

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Do the same thing to the function showViewAnnonces.
I don't know why it repeats code.. it should have used a function for this but.. it's being improved now.

6
wcrwcr
Re: MyAds - Last ads block
  • 2004/8/30 17:26

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Thanks Chad

It works!

And I learned how to concatenate two variables.

Your site rocks.
I?m not in the business but have a Kalopsita

7
ChadK
Re: MyAds - Last ads block
  • 2004/8/30 17:34

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Great.. yah that was one of the very first things I had to fix with the myAds software... also be sure you search for myAds and fix the other stuff that we've been working out over the last couple of months, namely the email problem. If you don't, your users will get the reminder email every time someone views the ads page. Could get annoying if you have a lot of users.

8
wcrwcr
Re: MyAds - Last ads block
  • 2004/8/31 2:24

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Ok, I found it here https://xoops.org/modules/newbb/viewtopic.php?topic_id=22094&forum=28

Another great fix!
Thanks Chad ( the arara man )

Login

Who's Online

337 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 337


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits