Making changes to the dolphin main ads page.

The main ads page is not in the dolphin page builders. Many have asked how to modify this page. This tutorial will show you how to modify various sections. Each code change in this tutorial will be done one at a time with a screen shot of the effect the change has. You can than apply what changes you prefer to your ads page.

Change 1) This code change will allow you to insert a div containing anything you want to the top of the All Ads block in the left hand column.

Open modules\boonex\ads\classes\BxAdsModule.php and go to line 1939

Look for the following.

$sLastAdsSection = DesignBoxContent($sCaption, $sLastAds, 1);
return $sLastAdsSection;
}

Modify to look like this. Adding the line in red.

$sLastAds = '<div style="padding:9px;text-align:center;">My content here</div>' . $sLastAds;

$sLastAdsSection = DesignBoxContent($sCaption, $sLastAds, 1);
return $sLastAdsSection;
}

The result will be this.

2-20-2011%201-59-41%20PM.png


Change 2) This is similar to the the first except it places the new content at the bottom of the All Ads block.

Open modules\boonex\ads\classes\BxAdsModule.php and go to line 1939

Look for the following.

$sLastAdsSection = DesignBoxContent($sCaption, $sLastAds, 1);
return $sLastAdsSection;
}

Modify to look like this. Adding the line in red.

$sLastAds .= '<div style="padding:9px;text-align:center;">My content here</div>';

$sLastAdsSection = DesignBoxContent($sCaption, $sLastAds, 1);
return $sLastAdsSection;
}

The result will be this.

2-20-2011%202-04-18%20PM.png

Change 3) This code change will allow you to insert a div containing anything you want to the top of the Latest Featured Ad block in the right hand column.

Open modules\boonex\ads\classes\BxAdsModule.php and go to line 2083

Look for the following.

$sTopAdOfAllDaySection = DesignBoxContent(_t('_bx_ads_last_featured'), $sTopAdOfAllDayValue, 1);

$sCategoriesSection = $this->genCategoriesBlock();

return <<<EOF

Modify to look like this. Adding the line in red.

$sTopAdOfAllDayValue = '<div style="padding:9px;text-align:center;">My content here</div>' . $sTopAdOfAllDayValue;

$sTopAdOfAllDaySection = DesignBoxContent(_t('_bx_ads_last_featured'), $sTopAdOfAllDayValue, 1);

$sCategoriesSection = $this->genCategoriesBlock();

return <<<EOF

The result will be this.

2-20-2011%202-12-49%20PM.png

 

Change 4) This is similar change 3 except it places the new content at the bottom of the Latest Featured Ad block.

Open modules\boonex\ads\classes\BxAdsModule.php and go to line 2083

$sTopAdOfAllDaySection = DesignBoxContent(_t('_bx_ads_last_featured'), $sTopAdOfAllDayValue, 1);

$sCategoriesSection = $this->genCategoriesBlock();

return <<<EOF

Modify to look like this. Adding the line in red.

$sTopAdOfAllDayValue .= '<div style="padding:9px;text-align:center;">My content here</div>';

$sTopAdOfAllDaySection = DesignBoxContent(_t('_bx_ads_last_featured'), $sTopAdOfAllDayValue, 1);

$sCategoriesSection = $this->genCategoriesBlock();

return <<<EOF

The result will be this.

2-20-2011%202-15-28%20PM.png

 

Change 5) This code change will allow you to insert a div containing anything you want to the top of the Categories block in the right hand column.

Open modules\boonex\ads\classes\BxAdsModule.php and go to line 2057

Look for the following.

return DesignBoxContent(_t('_bx_ads_Categories'), $sCategoriesBlocks, 1);
}

Modify to look like this. Adding the line in red.

$sCategoriesBlocks = '<div style="padding:9px;text-align:center;">My content here</div>' . $sCategoriesBlocks;

return DesignBoxContent(_t('_bx_ads_Categories'), $sCategoriesBlocks, 1);
}

The result will be this.

2-20-2011%202-21-46%20PM.png

Change 6) This is similar to change 5 except it places the new content at the bottom of the Categories block in the right hand column.

Open modules\boonex\ads\classes\BxAdsModule.php and go to line 2057

Look for the following.

return DesignBoxContent(_t('_bx_ads_Categories'), $sCategoriesBlocks, 1);
}

Modify to look like this. Adding the line in red.

$sCategoriesBlocks .= '<div style="padding:9px;text-align:center;">My content here</div>';

return DesignBoxContent(_t('_bx_ads_Categories'), $sCategoriesBlocks, 1);
}

The result will be this.

2-20-2011%202-25-20%20PM.png

This ends samples of placing content inside the existing blocks.

Now i will show you how to add additional blocks to the columns.

Change 7) This one will show you how to add a new block above or below the existing block in the left column.

Open modules\boonex\ads\classes\BxAdsModule.php and go to line 2083

Look for the following.

$sTopAdOfAllDaySection = DesignBoxContent(_t('_bx_ads_last_featured'), $sTopAdOfAllDayValue, 1);

$sCategoriesSection = $this->genCategoriesBlock();

return <<<EOF

Just above that, add this.

$MyNewBlockContent = '<div style="padding:9px;text-align:center;">My content here</div>';
$MyNewBlock = DesignBoxContent(_t('_MyNewLanguageKey'), $MyNewBlockContent, 1);

Now move down to line 2088

Look for this.

<div id="page_column_1" class="page_column page_column_first" style="width: 34%;">
<div class="page_block_container">
{$sLastAdsSection}
</div>
</div>

Insert the new line in red.

<div id="page_column_1" class="page_column page_column_first" style="width: 34%;">
<div class="page_block_container">
{$MyNewBlock}
</div>
<div class="page_block_container">
{$sLastAdsSection}
</div>
</div>

The result will be this.

2-20-2011%202-39-56%20PM.png

If you want the block under the existing block instead of on top, then just change this.

<div id="page_column_1" class="page_column page_column_first" style="width: 34%;">
<div class="page_block_container">
{$MyNewBlock}
</div>
<div class="page_block_container">
{$sLastAdsSection}
</div>
</div>

To This

<div id="page_column_1" class="page_column page_column_first" style="width: 34%;">
<div class="page_block_container">
{$sLastAdsSection}
</div>
<div class="page_block_container">
{$MyNewBlock}
</div>
</div>

To put the new block in the right column instead of the left or to add it to the right as well then look for this.

<div id="page_column_2" class="page_column page_column_last" style="width: 66%;">
<div class="page_block_container">
{$sTopAdOfAllDaySection}
</div>
<div class="page_block_container">
{$sCategoriesSection}
</div>
</div>

And add the lines in red.

<div id="page_column_2" class="page_column page_column_last" style="width: 66%;">
<div class="page_block_container">
{$MyNewBlock}
</div>
<div class="page_block_container">
{$sTopAdOfAllDaySection}
</div>
<div class="page_block_container">
{$sCategoriesSection}
</div>
</div>

Or at the bottom of the column

<div id="page_column_2" class="page_column page_column_last" style="width: 66%;">
<div class="page_block_container">
{$sTopAdOfAllDaySection}
</div>
<div class="page_block_container">
{$sCategoriesSection}
</div>
<div class="page_block_container">
{$MyNewBlock}
</div>
</div>

You can also add a full width block that spans both columns by doing this.

Change the following.

return <<<EOF
<div id="page_column_1" class="page_column page_column_first" style="width: 34%;">
<div class="page_block_container">
{$sLastAdsSection}
</div>
</div>
<div id="page_column_2" class="page_column page_column_last" style="width: 66%;">
<div class="page_block_container">
{$sTopAdOfAllDaySection}
</div>
<div class="page_block_container">
{$sCategoriesSection}
</div>
</div>
<div class="clear_both"></div>
EOF;
}

To this. Add the lines in red.

return <<<EOF
<div class="page_column" style="width: 100%;">
{$MyNewBlock}
</div>
<div class="clear_both"></div>

<div id="page_column_1" class="page_column page_column_first" style="width: 34%;">
<div class="page_block_container">
{$sLastAdsSection}
</div>
</div>
<div id="page_column_2" class="page_column page_column_last" style="width: 66%;">
<div class="page_block_container">
{$sTopAdOfAllDaySection}
</div>
<div class="page_block_container">
{$sCategoriesSection}
</div>
</div>
<div class="clear_both"></div>
EOF;
}

The result will be this.

2-20-2011%202-56-09%20PM.png

Or to put the full width row on the bottom of the page. Then do this.

Change the following.

return <<<EOF
<div id="page_column_1" class="page_column page_column_first" style="width: 34%;">
<div class="page_block_container">
{$sLastAdsSection}
</div>
</div>
<div id="page_column_2" class="page_column page_column_last" style="width: 66%;">
<div class="page_block_container">
{$sTopAdOfAllDaySection}
</div>
<div class="page_block_container">
{$sCategoriesSection}
</div>
</div>
<div class="clear_both"></div>
EOF;
}

To this. Add the lines in red.

return <<<EOF
<div id="page_column_1" class="page_column page_column_first" style="width: 34%;">
<div class="page_block_container">
{$sLastAdsSection}
</div>
</div>
<div id="page_column_2" class="page_column page_column_last" style="width: 66%;">
<div class="page_block_container">
{$sTopAdOfAllDaySection}
</div>
<div class="page_block_container">
{$sCategoriesSection}
</div>
</div>
<div class="clear_both"></div>
<div class="page_column" style="width: 100%;">
{$MyNewBlock}
</div>
<div class="clear_both"></div>

EOF;
}

 

Thats it. You should now have a pretty good idea of what can be done with the main ads page.

https://www.deanbassett.com
Quote · 20 Feb 2011

Hey Deano that is awesome!!!!!!

Its the first time I see this page is being addressed in the Forum.

How can I delete "All Ads" and "Featured Ads"? I want to have only the "Categories" block.

Thanks again & again & again &..............

Yuval

Sometimes communicating your problem and putting it out there is enough to solve it
Quote · 20 Feb 2011

 

Hey Deano that is awesome!!!!!!

Its the first time I see this page is being addressed in the Forum.

How can I delete "All Ads" and "Featured Ads"? I want to have only the "Categories" block.

Thanks again & again & again &..............

Yuval

Do you also want this as a single column? I am guessing you do considering you want the only block in the left column deleted.

If so, then at line 2087

Change this.

return <<<EOF
<div id="page_column_1" class="page_column page_column_first" style="width: 34%;">
<div class="page_block_container">
{$sLastAdsSection}
</div>
</div>
<div id="page_column_2" class="page_column page_column_last" style="width: 66%;">
<div class="page_block_container">
{$sTopAdOfAllDaySection}
</div>
<div class="page_block_container">
{$sCategoriesSection}
</div>
</div>
<div class="clear_both"></div>
EOF;



To This.

return <<<EOF
<div id="page_column" class="page_column" style="width: 100%;">
{$sCategoriesSection}
</div>
<div class="clear_both"></div>
EOF;

https://www.deanbassett.com
Quote · 20 Feb 2011

Yes. I want the left column deleted and the "featured" removed and to have just the "Categories" on one wide column.

Sometimes communicating your problem and putting it out there is enough to solve it
Quote · 20 Feb 2011

 

Yes. I want the left column deleted and the "featured" removed and to have just the "Categories" on one wide column.

I must have been editing my post as you were responding. Code above to do that.


https://www.deanbassett.com
Quote · 20 Feb 2011

I don't see it there. There's a tutorial of how to build a wide column but I figured that if I delete the left column and the "feature" blocks then I will be left with the "categories" block only in wide span.

I just need the points of deleting the left column and "featured" block.

Thanks.

Sometimes communicating your problem and putting it out there is enough to solve it
Quote · 20 Feb 2011

LOL. Ok here it is again. A repeat of what was above your last post. This will remove the left column and the block on the right leaving only the catagories.

At line 2087. Same file as all the other edits.

Change this.

return <<<EOF
<div id="page_column_1" class="page_column page_column_first" style="width: 34%;">
<div class="page_block_container">
{$sLastAdsSection}
</div>
</div>
<div id="page_column_2" class="page_column page_column_last" style="width: 66%;">
<div class="page_block_container">
{$sTopAdOfAllDaySection}
</div>
<div class="page_block_container">
{$sCategoriesSection}
</div>
</div>
<div class="clear_both"></div>
EOF;



To This.

return <<<EOF
<div id="page_column" class="page_column" style="width: 100%;">
{$sCategoriesSection}
</div>
<div class="clear_both"></div>
EOF;

https://www.deanbassett.com
Quote · 20 Feb 2011

SUPERMAN !!!!!

THERE'S NO OTHER WORD TO DESCRIBE DEANO92964......JUST.....SUPERMAN!!!!!!!!!!!!!!!!!!!!!!!!

I have been waiting for this for a long time Deano.

T H A N K  Y O U !!! Cool


Sometimes communicating your problem and putting it out there is enough to solve it
Quote · 20 Feb 2011

I should point out a couple of things with my above code that others have run into. So to clarify things a bit.

You would replace the words. My content here with your actual content.

If your content contains any single quotes. '     then replace them with double quotes. "

If a single quote is needed such as in an apostrophe in the word Didn't then you must escape it with a \ like so. Didn\'t

Your content can be pretty much any thing that can normally be placed in a html page such as javascript, text and images. But you do need to be careful with the use of single quotes.


https://www.deanbassett.com
Quote · 23 Feb 2011

Hi Deano,

Once again you have given us great info and support. Thank you.

Since we are on this subject, I wanted to find out if there is a way that the individual categories can be minimized initially to save space on the page? If a visitor wants then they can expand them.

 

Thanks

M

Quote · 18 Mar 2011

This is great - I had been looking around most of yesterday trying to find the right places to edit the main ads page, however, I have one question that I was wondering if you could answer?

I have only one category box and it's annoying the heck out of me that it's not spanning the entire width of the box it's contained in, see here:

Ads%20Home_1301518924249.jpg

Any idea how to fix this? Undecided

Quote · 30 Mar 2011

 

This is great - I had been looking around most of yesterday trying to find the right places to edit the main ads page, however, I have one question that I was wondering if you could answer?

I have only one category box and it's annoying the heck out of me that it's not spanning the entire width of the box it's contained in, see here:

Ads%20Home_1301518924249.jpg

Any idea how to fix this? Undecided

Yes.

In the function     function genCategoriesBlock() { which starts at about line 1943 look for this about 50 lines down at about line 1996 give or take a few lines depending on dolphin version.

<div style="width:{$iColumnWidth}%;float:left;position:relative;margin-left:1%;margin-right:1%;">

Remove part of the line marked so it looks like this.

<div style="position:relative;margin-left:1%;margin-right:1%;">



https://www.deanbassett.com
Quote · 30 Mar 2011

 

 

Yes.

In the function     function genCategoriesBlock() { which starts at about line 1943 look for this about 50 lines down at about line 1996 give or take a few lines depending on dolphin version.

<div style="width:{$iColumnWidth}%;float:left;position:relative;margin-left:1%;margin-right:1%;">

Remove part of the line marked so it looks like this.

<div style="position:relative;margin-left:1%;margin-right:1%;">



Nice Deano... Will this also work with other pages besides ads? I would like to do some of this on my home page and other pages

Quote · 30 Mar 2011

Not likley. All of this code is specific to the ads page and how it is structured. Not all pages use the same code or functions.

https://www.deanbassett.com
Quote · 30 Mar 2011

 

 

This is great - I had been looking around most of yesterday trying to find the right places to edit the main ads page, however, I have one question that I was wondering if you could answer?

I have only one category box and it's annoying the heck out of me that it's not spanning the entire width of the box it's contained in, see here:

Ads%20Home_1301518924249.jpg

Any idea how to fix this? Undecided

Yes.

In the function     function genCategoriesBlock() { which starts at about line 1943 look for this about 50 lines down at about line 1996 give or take a few lines depending on dolphin version.

<div style="width:{$iColumnWidth}%;float:left;position:relative;margin-left:1%;margin-right:1%;">

Remove part of the line marked so it looks like this.

<div style="position:relative;margin-left:1%;margin-right:1%;">



Aaaah, thankyou - I'll give it a try!  ( I originally posted this under my client's account, hence the name change Wink ).  You are, without a doubt, one of the most awesome guys here!!

 

EDIT: Worked like a charm Laughing

Quote · 31 Mar 2011

Great tutorial!

Is there one that teaches how to change the categories for the Ads?

Quote · 26 Nov 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.