Well as one way of trying to find more out a bit more about these banners I tried to re code my own banner type
This has essentially taken the form of adding a new banner type
My spec is to use the image url for the picture
The text area can contain pre amble text an marker for where the image is displayed and post image text
e.g
Head or title text[IMAGE]footer
would show the head text on a line above the image then the image then the footer text below - the image is the only clickable link the text is 'dead'
I have covered that if the image tag is missing then it is assumed that all the text is footer text
-Code Changes as follows
http://localhost/DotNetNuke/App_GlobalResources/GlobalResources.resx
Add
Name Value
BannerType.Untamed.String CustomBanner
http://localhost/DotNetNuke/admin/Vendors/Banners.ascx.vb
Public Function DisplayType
Add to case statement
Case Services.Vendors.BannerType.CustomBanner : _DisplayType = Services.Localization.Localization.GetString("BannerType.CustomBanner.String", Services.Localization.Localization.GlobalResourceFile)
..\Library\Components\Vendors\BannerTypeInfo.vb
Public Enum BannerType As Integer
Add CustomBanner = 8
..\Library\Components\Vendors\BannerTypeController.vb
Public Function GetBannerTypes() As ArrayList
Dim arrBannerTypes As New ArrayList
Add
arrBannerTypes.Add(New BannerTypeInfo(BannerType.CustomBanner, Services.Localization.Localization.GetString("BannerType.CustomBanner.String", Services.Localization.Localization.GlobalResourceFile)))
..\Library\Components\Vendors\BannerController.vb
Add
Case BannerType.CustomBanner
Dim WrkString As String = Description
Dim StrPos As Integer
StrPos = Instr(1, WrkString, "[IMAGE]")
If (StrPos > 1) Then
If Trim(Left(WrkString, StrPos)) <> "" Then
strBanner += "<span class=""BannerText"">" & Left(WrkString, StrPos - 1) & "</span><br>"
WrkString = Mid(Description, StrPos + 7)
End If
End If
If ImageFile.IndexOf("://") = -1 And ImageFile.StartsWith("/") = False Then
If ImageFile.ToLower.IndexOf(".swf") = -1 Then
strBanner += "<a href=""" & strURL & """ target=""" & strWindow & """>"
Select Case BannerSource
Case "L" ' local
strBanner += FormatImage(HomeDirectory & ImageFile, Width, Height, BannerName, Description)
Case "G" ' global
strBanner += FormatImage(Common.Globals.HostPath & ImageFile, Width, Height, BannerName, Description)
End Select
strBanner += "</a><br>"
Else ' flash
Select Case BannerSource
Case "L" ' local
strBanner += FormatFlash(HomeDirectory & ImageFile, Width, Height)
Case "G" ' global
strBanner += FormatFlash(Common.Globals.HostPath & ImageFile, Width, Height)
End Select
End If
Else
If ImageFile.ToLower.IndexOf(".swf") = -1 Then
strBanner += "<a href=""" & strURL & """ target=""" & strWindow & """>"
strBanner += FormatImage(ImageFile, Width, Height, BannerName, Description)
strBanner += "</a><br>"
Else ' flash
strBanner += FormatFlash(ImageFile, Width, Height)
End If
End If
If (StrPos > 0) Then
strBanner += "<span class=""BannerText"">" & Mid(Description, StrPos + 7) & "</span><br>"
Else
If Trim(WrkString) <> "" Then
strBanner += "<span class=""BannerText"">" & Description & "</span><br>"
End If
End If
----------
All seems well apart from the same problem I have been having before
The redline when left as shown above allows the counter to be updated for click throughs but unfortunately displays the home page of the local site rather than the url defined
When I change this line to
strBanner += "<a href=""" & URL & """ target=""" & strWindow & """>"
I then get the correct Url opened in a new window but unfortunately the count is no longer incremented????
Has anyone any Ideas where I am going wrong with this??