Author |
Topic |
|
Zenfor
Junior Member
372 Posts |
Posted - 07 August 2012 : 14:52:38
|
I am trying to put a twitter button on my forum inside inc_header and keep getting errors of course. I know enough asp to just get by but this has got me stumped. I have done other modifications but can't seem to get by this one. Appreciate any suggestions. thanks!
Twiiter code: quote: <a href="https://twitter.com/EastonMass" class="twitter-follow-button" data-show-count="false">Follow @EastonMass</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
This is where I want it to go: TWITTER BUTTON GOES HERE quote: "<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""100%"">" & vbNewLine & _ " <tr align=center colspan=4>" & vbNewLine & _ " <td valign=""top"" width=""25%""><a href=rss.asp target= _blank><img src=images/rssfeed.jpg border=0></a></td>" & vbNewLine & _ " <td valign=""top"" width=""25%""><img src=questions.gif></td>" & vbNewLine & _ " <td valign=""top"" width=""25%"">TWITTER BUTTON GOES HERE</td>" & vbNewLine & _ " <td valign=""top"" width=""25%"">" & vbNewLine & _ " </td></tr></table><br><hr noshade>" & vbNewLine & _
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 07 August 2012 : 17:21:10
|
Try:
"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""100%"">" & vbNewLine & _ " <tr align=center colspan=4>" & vbNewLine & _ " <td valign=""top"" width=""25%""><a href=""rss.asp"" target="" _blank""><img src=""images/rssfeed.jpg"" border=""0""></a></td>" & vbNewLine & _ " <td valign=""top"" width=""25%""><img src=""questions.gif""></td>" & vbNewLine & _ " <td valign=""top"" width=""25%"">TWITTER BUTTON GOES HERE</td>" & vbNewLine & _ " <td valign=""top"" width=""25%"">" & vbNewLine & _ " </td></tr></table><br><hr noshade>" & vbNewLine & _
If that doesn't work I'm sure Carefree will be along at some point |
|
|
Zenfor
Junior Member
372 Posts |
Posted - 07 August 2012 : 17:50:09
|
There's nothing to try, that's exactly what I quoted. I need to insert the twitter code where I marked it to go. Thanks! |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 08 August 2012 : 02:37:29
|
Try:
Create a new file and call it inc_twitter.asp
Within the new blank file paste the following, save and upload to your forum directory:
<td valign="top" width="25%"> <a href="https://twitter.com/EastonMass" class="twitter-follow-button" data-show-count="false">Follow @EastonMass</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> </td>
Then use the following code inside inc_header,asp:
"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""100%"">" & vbNewLine & _ " <tr align=center colspan=4>" & vbNewLine & _ " <td valign=""top"" width=""25%""><a href=""rss.asp"" target="" _blank""><img src=""images/rssfeed.jpg"" border=""0""></a></td>" & vbNewLine & _ " <td valign=""top"" width=""25%""><img src=""questions.gif""></td>" & vbNewLine %> <!--#INCLUDE FILE="inc_twitter.asp"--> <% ResponseWrite " " <td valign=""top"" width=""25%"">" & vbNewLine & _ " </td></tr></table><br><hr noshade>" & vbNewLine & _
I haven't tested it but should work
PS Your original code missed out a lot of ' " 's |
Edited by - Webbo on 08 August 2012 02:40:09 |
|
|
Zenfor
Junior Member
372 Posts |
Posted - 08 August 2012 : 06:43:42
|
quote: Originally posted by Webbo
Try:
Now I get this error the first line after the include section:
quote: Microsoft VBScript compilation error '800a0401'
Expected end of statement
/forum/inc_header.asp, line 310
ResponseWrite " " <td valign=""top"" width=""25%"">" & vbNewLine & _ ----------------------^
Bythe way, the twitter code is exactly what came from twitter, I didn't remove anything. Thank you very much for your help. |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 08 August 2012 : 17:44:38
|
My bad, change: ResponseWrite " " <td valign=""top"" width=""25%"">" & vbNewLine & _
to: Response.Write " " <td valign=""top"" width=""25%"">" & vbNewLine & _
|
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 08 August 2012 : 17:56:15
|
quote: Originally posted by Webbo
My bad, change: ResponseWrite " " <td valign=""top"" width=""25%"">" & vbNewLine & _
to: Response.Write " " <td valign=""top"" width=""25%"">" & vbNewLine & _
Duplicated the error. Remove the first quotation mark, thus:
Response.Write " <td valign=""top"" width=""25%"">" & vbNewLine & _ |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 08 August 2012 : 17:58:50
|
Cheers Cf
I'm tired lol |
|
|
Zenfor
Junior Member
372 Posts |
Posted - 08 August 2012 : 19:40:31
|
quote: Originally posted by Webbo
Cheers Cf
I'm tired lol
You're a genius, that worked! Thank you very much for the help everyone, you guys rock!
Had to make one correction though.
quote: Response.Write instead of ResponseWrite
|
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 09 August 2012 : 02:15:15
|
No problem glad to help
(I corrected the lack of dot in my third post but it went un-noticed ) |
|
|
|
Topic |
|