AdsManager and Chronoform

marpal87 01 Feb, 2016
Good morning everyone,
I need to call the title of the ads that i put in AdsManager into Chronoform's form
Could someone help me ?
Thanks so much.
GreyHead 01 Feb, 2016
Hi marpal87,

I have no idea what Ads Manager is or how it works. Where is the title available?

Bob
marpal87 01 Feb, 2016
Hi Bob,
this is the code of the title

<h1 class="no-margin-top">	
			<?php 
			if (isset($this->fDisplay[1]))
			{
				foreach($this->fDisplay[1] as $field)
				{
					$c = $this->field->showFieldValue($this->content,$field); 
					if (($c !== "")&&($c !== null)) {
						$title = $this->field->showFieldTitle(@$this->content->catid,$field);
                        if($field->name != 'ad_headline')
	                        echo "<span class='f".$field->name."'>";
						if ($title != "")
							echo "<b>".htmlspecialchars($title)."</b>: ";
						echo "$c ";
                        if($field->name != 'ad_headline')
                            echo "</span>";
					}
				}
			} ?>
			</h1>
GreyHead 01 Feb, 2016
Hi marpal87,

It looks as though perhaps you could use JavaScript to find the title in the <h1> tag and copy that to a Hidden input in your form.

Bob
marpal87 01 Feb, 2016
How can i make it?
Thanks
GreyHead 01 Feb, 2016
Hi marpal87,

You'd need to find a unique CSS identifier for the <h1> tag, use JavaScript to extract the ext from that and copy it to the value of a hidden input in your form.

You may need help from someone with some JavaScript and jQuery experience.

Bob
marpal87 02 Feb, 2016
Hi Bob,
I solved my problem with this code:

<?php
$db =& JFactory::getDBO(); 
$db->setQuery('SELECT ad_headline FROM #__adsmanager_ads WHERE id="1"');
$frcchiolla= $db->loadResult(); 
?>

Now the problem is that i want a dynamic ID.
What code i have to add?
Thanks so much ๐Ÿ™‚
GreyHead 02 Feb, 2016
Hi marpal87,

There's nothing here to give me any clue about where the id is available :-(

Bob
GreyHead 02 Feb, 2016
Hi marpal87,

I don't need anything thank you - you need to know where that id is available from.

Bob
This topic is locked and no more replies can be posted.