Announcement

Collapse
No announcement yet.

For Sale Section

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Glenn Vergara
    replied
    Can you try other browser such as Chrome or FIrefox? I want to know if this is just an IE issue only. Also please check the javascript console (F12) for any errors.

    If you want faster assistance, you need to give me access to your forum.

    Leave a comment:


  • tomcoleman
    replied
    I got these pop ups

    Click image for larger version

Name:	1.JPG
Views:	2
Size:	65.9 KB
ID:	4324931






    Click image for larger version

Name:	2.JPG
Views:	3
Size:	57.3 KB
ID:	4324932

    Leave a comment:


  • Glenn Vergara
    replied
    Try adding the 2 lines in red temporarily for debugging purposes and running the page again?

    If you don't get 2 alerts, then something is wrong. You may need to give me access to your forum to debug deeper.

    Code:
    <script>
    (function() {
        var newContent = document.querySelector('.new-content-widget'),
            channelIds = [18, 50, 53, 56]; //put all node ids of channels that this script should only apply to (get node ids from AdminCP > Channel Management > Channel Manager)
                
        if (newContent && channelIds.indexOf(Number(location.pathname.substring(location.pathname.lastIndexOf('/') + 1))) !== -1) {
            alert('You are in the correct channel ID'); //debug
            window.addEventListener('load', function() {
                alert('Initializing editor with default values'); //debug
                var editorId = newContent.querySelector('.js-editor').id,
                    editor = vBulletin.ckeditor.getEditor(editorId),
                    fields = ['Item Location', 'Age', 'Amount ']; //add more fields as needed
                    data = '<strong>' + fields.join('</strong>:&nbsp;<br /><strong>') + '</strong>: ';
            
                editor.setData(data);
    
            });
        }
    })();
    </script>

    Leave a comment:


  • Mark.B
    replied
    Originally posted by tomcoleman View Post
    any update?!?!?!
    Please be aware that this issue is outside the scope of vBulletin support.
    Glenn is a former vBulletin developer who is helping you out of courtesy in his own time. Bumping the thread won't help, because the support team are not coders and cannot assist.

    If you need faster assistance, it may be worth posting on www.vbulletin.org, the modification and customization site.
    Failing that, the only route will be waiting for Glenn, but there is no guarantee of any timescale, or even that he will respond at all.

    Leave a comment:


  • tomcoleman
    replied
    any update?!?!?!

    Leave a comment:


  • tomcoleman
    replied
    Click image for larger version

Name:	3.JPG
Views:	2
Size:	13.5 KB
ID:	4324649

    enabled in hooks

    Leave a comment:


  • tomcoleman
    replied
    In answer to your questions


    Yes I have set the names the same - see attached.

    Yes I can see the code when I do view source.

    Click image for larger version

Name:	1.JPG
Views:	4
Size:	34.6 KB
ID:	4324644
    Click image for larger version

Name:	2.JPG
Views:	2
Size:	90.4 KB
ID:	4324645
    Click image for larger version

Name:	3.JPG
Views:	2
Size:	13.5 KB
ID:	4324646



    Click image for larger version

Name:	4.JPG
Views:	2
Size:	79.7 KB
ID:	4324647

    Leave a comment:


  • Glenn Vergara
    replied
    So you renamed the template name in the "For Sale Section Pre Fill" hook to "TSB"? Is the hook active? Are you testing on the page while it is on TSB Theme? When you are on the Create New Topic page, right click and choose View source (or View page source). Can you see the content of the template in the page source?

    Leave a comment:


  • tomcoleman
    replied
    all named the same still doesn't work

    Leave a comment:


  • Glenn Vergara
    replied
    You named the template as "TSB" but in the hook, you set the template name to "TSB Theme". These 2 should match. Update the template name in the hook.

    Leave a comment:


  • tomcoleman
    replied
    any ideas?

    Leave a comment:


  • tomcoleman
    replied
    this doesn't work

    See attached

    Click image for larger version

Name:	dead.JPG
Views:	12
Size:	87.8 KB
ID:	4324345

    Click image for larger version

Name:	dead2.JPG
Views:	13
Size:	75.0 KB
ID:	4324347 Click image for larger version

Name:	dead.JPG
Views:	12
Size:	87.8 KB
ID:	4324346

    Leave a comment:


  • Glenn Vergara
    replied
    I modified the script to filter out forum channels.

    Code:
    <script>
    (function() {
        var newContent = document.querySelector('.new-content-widget'),
            channelIds = [50, 56]; //put all node ids of channels that this script should only apply to (get node ids from AdminCP > Channel Management > Channel Manager)
                
        if (newContent && channelIds.indexOf(Number(location.pathname.substring(location.pathname.lastIndexOf('/') + 1))) !== -1) {
            window.addEventListener('load', function() {
    
                var editorId = newContent.querySelector('.js-editor').id,
                    editor = vBulletin.ckeditor.getEditor(editorId),
                    fields = ['Item Location', 'Age', 'Amount ']; //add more fields as needed
                    data = '<strong>' + fields.join('</strong>:&nbsp;<br /><strong>') + '</strong>: ';
            
                editor.setData(data);
    
            });
        }
    })();
    </script>
    To create a template, select "Add New Template" in the dropdown for the TSB Theme in the Style Manager. Type a template name in the Title field and then paste the above code in the Template field. Then go back to the hook you created and update the Template Name field to the template name you created.

    Note: If you support IE8, you need to add an Array.indexOf polyfill script before my script. You can find a polyfill on this MDN page:

    https://developer.mozilla.org/en-US/.../Array/indexOf

    Leave a comment:


  • tomcoleman
    replied
    Originally posted by Dominic View Post
    Did you turn on the hook too?
    yes I did

    I also need to know

    when this works will it only apply to certain areas of the board? for example ONLY the for sale / classified section

    Leave a comment:


  • Dominic
    replied
    Did you turn on the hook too?

    Leave a comment:

Related Topics

Collapse

Working...
X