vBulletin Newsletter [Deleted]

Status
Not open for further replies.

djbaxter

Tazmanian Veteran
Joined
Jun 6, 2006
Messages
10,485
So far, just this one. I'm also using PHP 7.1 so I would need compatibility with that.

I have Important and Popular disabled. Just using latest threads.

The newsletter (just test emails so far) is including moderator only and administrator only threads, as well as members only threads.

Ideally, I would want to be able to select the threads to draw from with a dropdown rather than all the forum IDs. In fact, I tried specifying forum IDs (from my very long list of forums) and got database errors.
 

markoroots

Participant
Joined
Nov 6, 2016
Messages
78
The solution is very easy, and when you'll read you'll say "Dammit, was so simple".

The code is correct. The image is correct but if you're seeing the newsletter locally. But you forgot that this email will be read at user's computer. So simple you need to add the full URL to your logo. eg. http://www.mydomain.com/images/logo.png

That's all.
Many thanks, you are a great. It work. :)





I think that maybe Chris ask all the problems came out from this thread.
This is a list of all posts with problems, I will check better if I loose something.
Maye some are just resolved, I don't know, but sure is good to have a quick view an all.

Just installed this and trying to set it up.

vBulletin 4.2.5 with Blog and CMS.

Apache, MariaDB 10.0.31, PHP 7.1.7

Getting these errors in the ACP trying to configure it - when I say I'm getting these errors, I mean they are displayed in the right panel as soon as I click on those settings categories, so I can't even configure them:

Schedule Newsletters
Code:
syntax error, unexpected 'new' (T_NEW) on line 147 in /home/psychlin/public_html/forum/newsletter/functions.php
#0 {main}

Preview Newsletter

Code:
syntax error, unexpected 'new' (T_NEW) on line 147 in /home/psychlin/public_html/forum/newsletter/functions.php
#0 {main}
Blacklisted Emails
Code:
syntax error, unexpected 'new' (T_NEW) on line 147 in /home/psychlin/public_html/forum/newsletter/functions.php
#0 {main}
Newsletters Archive
Code:
syntax error, unexpected 'new' (T_NEW) on line 147 in /home/psychlin/public_html/forum/newsletter/functions.php
#0 {main}

For this was relased an Update from Chris.



The 'Preview Newsletter' function works perfectly, but I can't get the global 'Schedule Newsletters' feature to work (i.e. I have set up some scheduled email send dates and times, but it's not sending).As mentioned I am not super familiar with email settings in cPanel. Would you be willing to take a look at my 'Mail Server Options and see what the issue is if I send you cPanel and site admin vB access?


my site is active. When I manually do the cron jobs, it looks like it allows me to prepare the newsletter and put it in the queue but when I run the cron to send the newsletter it says 'message body empty'
For this was relased a new Version of the Newsletter plugin



The same error occurred on line 1580 of functions.php

On Php 7

For this DjBaxter relase a new copy of the file functions.php

It is including latest threads from private (hidden) forums. The settings indicate that it shouldn't be doing this.
In all blocks (eg Important, Popular etc) or just in Latest Threads?
I have Important and Popular disabled. Just using latest threads.

The newsletter (just test emails so far) is including moderator only and administrator only threads, as well as members only threads.

Ideally, I would want to be able to select the threads to draw from with a dropdown rather than all the forum IDs. In fact, I tried specifying forum IDs (from my very long list of forums) and got database errors.

Signed by Chris for next update


Yes I can confirm that too me I have this problem and I have also noted that this problem come when is added some forum ids in "Popular thread forumids" or is changed the number of the "News and Annunciaments" tab.
Maybe this could be helpful for Chris.
So far, just this one. I'm also using PHP 7.1 so I would need compatibility with that.
 
Last edited:

markoroots

Participant
Joined
Nov 6, 2016
Messages
78
I have checked post by post and corrected this previous one that riassume all. I hope that I haven't forghet nothing.
But I check 2 time.
 

ChrisTERiS

Neophyte
Joined
Jan 16, 2015
Messages
2
Ideally, I would want to be able to select the threads to draw from with a dropdown rather than all the forum IDs. In fact, I tried specifying forum IDs (from my very long list of forums) and got database errors.
That's the problem and I was wondering why I didn't set it this way since the initial release. That place holds vB settings and vB setting can't hold multiple selections. I searched all vb xml files but nowhere I found any multiple selection, only single selections like language, style etc. Please note that I'm talking for General Options. In other parts like Forum and Moderators there are multiple selections.

As you can see in the attached screenshot the only that I succeeded to do is to make the selection box multiple, but the system saves only one (the last) selection.

Thinking of it I found a solution, which actually improves a lot the functionality of the Newsletter. To move this setting to Newsletter setup. So in addition to usergroup selection you can select (per Newsletter now and not globally), from which forums to get Announcement, Latest etc etc. The improvement is that this way you can setup different newsletters per usergroup. eg for Members only to include threads from A,B,C forums while for Moderators from B,D,Z etc.

The problem is that this will cause problems to those who already have this mod active with reccuring newsletters. Don't think that exist, but you never know. So, I need to think deeper to find a solution for this.

That's my news for the moment.

Chris
vbnewsletter.jpg
 

djbaxter

Tazmanian Veteran
Joined
Jun 6, 2006
Messages
10,485
if empty, will include all forums EXCEPT those which are set as not visible and closed threads
How are you defining "not visible" - not visible to which usergroups? Does this follow the permissions for the recipients usergroup, i.e, user with access to a private forum will see threads from that forum while users without access will not receive those listings?

Would it not be easier to use forums to EXCLUDE rather than which ones to INCLUDE? Normally, that would be a much shorter list.
 

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,262
Christos,

When I wish to select forums in a product setting, in the "Option Code" I use:

Code:
"; $forums = array(-1 => $vbphrase['all']);
if (is_array($vbulletin->forumcache))
{
   foreach($vbulletin->forumcache AS $forumid => $forum)
   {
       $forums["$forum[forumid]"] = construct_depth_mark($forum['depth'], '--') . ' ' . $forum['title'];
   }
}
$right = "<select name=\"setting[$setting[varname]][]\" id=\"".$setting[varname]."\" tabindex=\"1\" class=\"bginput\" size=\"10\" style=\"width:90%;\" multiple=\"multiple\">\n";
$right .= construct_select_options($forums, explode(',',$vbulletin->options[$setting[varname]]), false);
$right .= "</select>\n<div class=\"smallfont\" style=\"width:90%;text-align:center\">Hold down the [CTRL] key to select multiple forums</div>"; $null = "
Make sure the "Data Validation Type" is "Free."

Then in a plugin hooked at "admin_options_processing", I use the code:

PHP:
if ($oldsetting['varname'] == 'markfl_att_forums')
{
   $fsett = 'markfl_att_forums';
   if (is_array($settings[$fsett]))
   {
       if (in_array(-1, $settings[$fsett]))
       {
           $settings[$fsett] = '-1';
       }
       else
       {
           $settings[$fsett] = implode(',', $settings[$fsett]);
       }
   }
   $fsett = '';
}
Replace both instances of 'markfl_att_forums' with the Varname of your setting. The end result is that the selected forumids are stored as a comma-delimited list.
 

ChrisTERiS

Neophyte
Joined
Jan 16, 2015
Messages
2
MarkFL

Thank you Mark. Really appreciated. Comma-delimited list is fine. I wasted hours to make that name=\"setting[$setting[varname]][]\" array but even if I was not getting any error, only the last selection was saved. Even tried (even if I nowhere seen it) as set as Data Validation Type array, arrayint, array_int but none worked.

My last try was with:
Code:
               <optioncode><![CDATA[" . eval('$options = "<select name=\\"setting[$setting[varname][]]\\">";
   foreach($vbulletin->forumcache AS $forumid => $forum)
   {
       $forum[depth] = count(explode(",", $forum[parentlist])) - 2;
       $forum[i] = 0;
       while ($forum[i] < $forum[depth])
       {
           $forum[spacing] .= " - ";
           $forum[i]++;
       }
       $options .= "\\t\\t<option value=\\"$forumid\\" " . iif($setting[value]==$forumid, \' selected="selected"\') . iif($vbulletin->debug, " title=\\"name=&quot;setting[$setting[varname]]&quot;\\"") . ">$forum[spacing] $forum[title_clean]</option>\\n";
   }
   $options .= "</select>";
   return "\\n$options\\t";
') . "]]></optioncode>
but again no luck. Tomorrow morning I'll try your solution. Again Thank you !!
 

Paul M

Limeade Addict
Joined
Jun 26, 2006
Messages
3,932
I wrote some code for this many years ago - for all my vB4 mods.

If you pick one, like the Top Posters mod, you will find a multiple forum selector like this ;

Untitled.png

It uses two hooks (admin_options_print & admin_options_processing) to create two new settings types ("forums:none" & "usergroups:none")

The first is the forum list, the second is a similar multiple usergroups selector. As I recall, the data is stored as a serialized array.
 

ChrisTERiS

Neophyte
Joined
Jan 16, 2015
Messages
2
Maybe it will takes 1-2 days more, but as long as I started updating this addon, I think that is better to spend some more time to add some more features.

One of them is to make the emails responsive. Maybe waste of time as vB3 & vB4 does not have responsive design, but why not?

By the way to remind that this addon is also compatible with vB3.x. The only that you need is to change a setting (default is vB4) for the version that you're using. And by writing this, I just realized that this is an "idiot" setting as version is something that I can easily get. :confused:
 

ChrisTERiS

Neophyte
Joined
Jan 16, 2015
Messages
2
MarkFL

Any idea why it gives "Error" instead of the selection list?

Code:
<setting varname="newsletter_forum_news_ids" displayorder="70">
               <datatype>free</datatype>
               <optioncode><![CDATA[           
               "; $forums = array(-1 => $vbphrase['all']);
               if (is_array($vbulletin->forumcache))
               {
                   foreach($vbulletin->forumcache AS $forumid => $forum)
                   {
                       $forums["$forum[forumid]"] = construct_depth_mark($forum['depth'], '--') . ' ' . $forum['title'];
                   }
               }
               $right = "<select name=\"setting[$setting[varname]][]\" id=\"".$setting[varname]."\" tabindex=\"1\" class=\"bginput\" size=\"10\" style=\"width:90%;\" multiple=\"multiple\">\n";
               $right .= construct_select_options($forums, explode(',',$vbulletin->options[$setting[varname]]), false);
               $right .= "</select>\n<div class=\"smallfont\" style=\"width:90%;text-align:center\">Hold down the [CTRL] key to select multiple forums</div>"; $null = "
               ') . "]]></optioncode>
               <defaultvalue></defaultvalue>
</setting>


<plugin active="1" executionorder="10">
   <title>Exclude Latest Forums</title>
    <hookname>admin_options_processing</hookname>
    <phpcode><![CDATA[
           if ($oldsetting['varname'] == 'newsletter_forum_news_ids')
           {
              $fsett = 'newsletter_forum_news_ids';
              if (is_array($settings[$fsett]))
              {
                  if (in_array(-1, $settings[$fsett]))
                  {
                      $settings[$fsett] = '-1';
                  }
                  else
                  {
                      $settings[$fsett] = implode(',', $settings[$fsett]);
                  }
              }
              $fsett = '';
           }
    ]]></phpcode>
</plugin>
 

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,262
Did you add the code by editing your .XML file, or by editing the product setting from within the AdminCP? In my .XML file it looks like:

Code:
           <setting varname="markfl_att_forums" displayorder="50">
               <datatype>free</datatype>
               <optioncode><![CDATA["; $forums = array(-1 => $vbphrase['all']);
if (is_array($vbulletin->forumcache))
{
   foreach($vbulletin->forumcache AS $forumid => $forum)
   {
       $forums["$forum[forumid]"] = construct_depth_mark($forum['depth'], '--') . ' ' . $forum['title'];
   }
}
$right = "<select name=\"setting[$setting[varname]][]\" id=\"".$setting[varname]."\" tabindex=\"1\" class=\"bginput\" size=\"10\" style=\"width:90%;\" multiple=\"multiple\">\n";
$right .= construct_select_options($forums, explode(',',$vbulletin->options[$setting[varname]]), false);
$right .= "</select>\n<div class=\"smallfont\" style=\"width:90%;text-align:center\">Hold down the [CTRL] key to select multiple forums</div>"; $null = "]]></optioncode>
               <defaultvalue>-1</defaultvalue>
           </setting>
 

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,262
I edited the .xml file and then imported it checking overwrite.
I don't see why that wouldn't work, but what I always do is edit the settings within the AdminCP, and then export the product to create a new .XML file.

The only difference I see in your .XML file and mine is the white space at the beginning and end of the code...try editing the .XML file so that it looks exactly like mine.
 

ChrisTERiS

Neophyte
Joined
Jan 16, 2015
Messages
2
The only difference I see in your .XML file and mine is the white space at the beginning and end of the code...try editing the .XML file so that it looks exactly like mine.
Tried it but no luck. What appears strange to me is the "Error" text. I was expected a screen break especially in admincp. Maybe because there was already data there? You never know.

Anyway, I'll move these settings to my own database, where I know how to do things happen.

Thank you :)
vbnews.jpg
 

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,262
Okay, if you still run into issues, let me know, and I will download and import your product and see if I can make the change on my local dev site and then email the new .XML file to you.
 

markoroots

Participant
Joined
Nov 6, 2016
Messages
78
Hi Chris but it seems like a forum home page and not a newsletter. Or am I that I loose something? :)
 

markoroots

Participant
Joined
Nov 6, 2016
Messages
78
I was continuing to look the screenshots but i don't/didn't understand.
ButIf you are planing to make the layout of the newsletter with the header of the forum home page (of the forum where is installed) then it's really great, you are a genius. :)
 
Status
Not open for further replies.
Top