News:

Wondering if this will always be free?  See why free is better.

Main Menu

PMx-Subforums v1.41 (updated 03 Jul 2013t)

Started by feline, September 08, 2011, 11:48:37 AM

Previous topic - Next topic

luuuciano

Feline, Im using ADK Portal, that have a block information that shows "auto news", new threads generated in certain forums, selectables on the block setup... that kind of aproach do not work well with pmx-subforums (as it shows allways the same content on every domain/forum)...
It would be too complicated to adapt it, to show latest X new threads on public/accesible boards of the current domain? (instead having to select sections by hand)

here the function that generate it:


function adk_aportes_automaticos($array = '', $limit_body = '', $limit_query = '')
{

global $context, $scripturl, $txt, $settings, $smcFunc, $boardurl, $adkportal;
global $modSettings;

if(empty($array))
$array = explode(',',$adkportal['auto_news_id_boards']);
else
$array = explode(',',$array);

if(empty($limit_body))
$limit_body = $adkportal['auto_news_limit_body'];

if(empty($limit_query))
$limit_query = $adkportal['auto_news_limit_topics'];

$context['start'] = isset($_REQUEST['adk']) ? !empty($_REQUEST['start']) ? (int)$_REQUEST['start'] : 0 : 0;
   
$sql = $smcFunc['db_query']('','
SELECT COUNT(*) AS total
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
WHERE b.id_board IN ('.implode(',',$array).') AND {query_wanna_see_board}
');
   
$row = $smcFunc['db_fetch_assoc']($sql);
$smcFunc['db_free_result']($sql);
   
$total = $row['total'];
$context['page_index'] = constructPageIndex($scripturl . '?adk', $context['start'], $total, $limit_query);

$sql = $smcFunc['db_query']('','
SELECT m.id_topic, m.poster_time, m.id_member, m.poster_name,
m.subject, m.body, m.icon, mg.online_color, t.num_replies, t.num_views, mem.real_name, mem.avatar,
IFNULL(a.id_attach, 0) AS id_attach, a.filename, a.attachment_type
FROM {db_prefix}messages AS m
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = IF(mem.id_group = 0, mem.id_post_group, mem.id_group))
INNER JOIN {db_prefix}topics AS t ON (t.id_first_msg = m.id_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
WHERE m.id_board IN ('.implode(',',$array).') AND {query_wanna_see_board}
ORDER BY m.id_topic DESC LIMIT {int:uno}, {int:limit} ',
array(
'limit' => $limit_query,
'uno' => $context['start'],
)
);


$img = 'plugin.png';

$topics = array();

while($row = $smcFunc['db_fetch_assoc']($sql))
{
if(!empty($row['id_member']))
$member = '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'" style="color: '.$row['online_color'].';">'.$row['real_name'].'</a>';
else
$member = $row['poster_name'];


$topics[] = array(
'v' => $row['num_views'],
'r' => $row['num_replies'],
'avatar' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img width="30" height="30" src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img width="30" height="30" src="' . $row['avatar'] . '" alt="" border="0" />' : '<img width="30" height="30" src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row['avatar']) . '" alt="" border="0" />'),
'id_topic' => $row['id_topic'],
'img' => '<img style="vertical-align: middle;" src="'.$settings['images_url'].'/post/'.$row['icon'].'.gif" alt="" />',
'href' => $row['subject'],
'time' => timeformat($row['poster_time']),
'member' => $member,
'body' => str_replace('<img ','<img style="max-width: 350px;" ',parse_bbc(substr($row['body'],0,$limit_body)))
);
}
//$averiguar = $avatar2,1,4);
$smcFunc['db_free_result']($sql);


foreach($topics AS $topic)
{
$title = '<a href="'.$scripturl.'?topic='.$topic['id_topic'].'.0"><b>'.$topic['href'].'</b></a>';

echo'
<div class="title_bar">
<h3 class="titlebg">
'.$topic['img'].$title.'
</h3>
</div>';

echo'
<div style="height: 40px;">

<div class="smalltext adk_float_r">'.$txt['by'].' '.$topic['member'].' - '.$topic['time'].'</div>';

if(!emptY($topic['avatar']))
echo'
<div class="adk_float_l">',$topic['avatar'],'</div>';

echo'
</div>

<div class="adk_padding_8">
'.$topic['body'].'
</div>

<br />';

if(!empty($adkportal['adk_bookmarks_autonews']))
adk_bookmarks('right','auto_news',$topic['id_topic']);

echo'
<div class="windowbg2 smalltext adk_padding_5">
<a href="'.$scripturl.'?topic='.$topic['id_topic'].'.0"><strong>'.$txt['learn_more'].'...</strong></a>
<div class="adk_float_r">
'.$txt['views'].': '.$topic['v'].'  '.$txt['replies'].': '.$topic['r'].'
</div>
</div>
<div class="adk_height_3"></div>';

}

echo'<div class="adk_align_right">'.$txt['adk_admin_pages'].': '.   $context['page_index'].'</div>';
echo'<div class="adk_height_1"></div>';

}
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

feline

I don't known ADK  :P .. but the query returns correct results for SubForums (tested with a PortaMx php block) ...
With the token {query_wanna_see_board} in the query the boards from a Subforums are filtered.
Call the author of ADK if any caching active or whatever ...


RCC_SaMiaM

I tried this on a fresh install, it is still the same deal, both domains see the exact same thing, but when viewing the Subforums Manager the correct check mark is next to the domain that I am viewing it with, so it knows what domain is being used, just not honoring the permissions (showing the correct boards and theme).

Please let me know what to try :)

feline

I don't known your server and your settings on this .. nothing.
And so .. I can nothing say about this.
All what I can say .. it works correct on our Servers and many other. So this is not a Problem with the Mod ...

RCC_SaMiaM

There has to be something I could test for, I don't know what since I didn't create the mod.  Like I said, the mod recognizes the domains.  So it is aware of that.  It just doesn't honor the settings for the domain.

Both domains have the same IP.
moparnetwork is an actual website with a physical location on the server
traildustercentral is just a domain that is aliased to moparnetwork, no physical location on the server.

The domains both have the same name servers, the name servers has entries for both domains pointing to the same IP.  In the control panel for moparnetwork, traildustercentrail is aliased to point to it.

Is that incorrect?

luuuciano

Today I have tried it... pmxsubforums and aliased domains (not subdomains)... and happened that, forums are filtered ok, but default theme is not used (it is used the smf default, curve)... I had to force it on the subforums setup
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

RCC_SaMiaM

luuuciano could you let me know how you setup your domains and aliasing?  Maybe I am not doing it correctly?

luuuciano

Well... I have no cpanel, etc... Im on a linode vps.... I have used ServerAlias on the vhost conf file (apache)
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

RCC_SaMiaM

I have this in my vhost file, this is the only part I thought relevant so only part I am posting

ServerName   moparnetwork.com:443
        ServerAlias  www.moparnetwork.com
        UseCanonicalName Off
        ServerAlias  traildustercentral.com
        ServerAlias  www.traildustercentral.com

luuuciano

No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).


luuuciano

Anyway, I had the same problem than you, I think... no idea why... when used on several domains (no subdomains), it lost the default theme function
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

luuuciano

Quote from: feline on March 06, 2012, 09:07:27 PM
I don't known ADK  :P .. but the query returns correct results for SubForums (tested with a PortaMx php block) ...
With the token {query_wanna_see_board} in the query the boards from a Subforums are filtered.
Call the author of ADK if any caching active or whatever ...

Their block shows new threads from a selection of forums (selected in the block setup)...
That forum numbers are used as an array in the query...
There is any way to know the pmx-subforum forum selection setup for the current domain? is that an array too?
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

feline

all informations about the categories, the boards and other are stored in the table {db_prefix}subforums.
Look at this to find the informations you need ...

luuuciano

#94
Quote from: feline on March 09, 2012, 04:22:51 PM
all informations about the categories, the boards and other are stored in the table {db_prefix}subforums.
Look at this to find the informations you need ...

Thanks!
I saw it... but... selected forums, for each domain, are not stored there?
I just see an Id, forum host, forum name, cat order, id theme, language, ac groups

EDIT: lol, I was looking at that again... and saw cat order... 1... 2... 3... 21,31........
21,31????
The first time looking at 123 I thought it was the order of subforums (order to show it somewhere... or something else)
You should change that table name, lol
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

RCC_SaMiaM

I would really love to use this!

There has to be something I can test for to see why this doesn't work.  Like I said before, when viewing the subforum admin panel in a domain, it shows a check next to that domain.  Does that mean it should work since it recognizes the correct domain?  It does it for both of my domains.

If not, how about some basic instructions on how you have to setup the dns/subdomain/domain for this to work?

feline

The check before the domain is only a info mark that say "You are on this domain"  ;)
And DNS setup is normally not necessary .. Domain Alias don't need that.

RCC_SaMiaM

You have to point the domain somewhere (nameservers) and the nameservers have to route the domain to an IP correct?  I really want to use this but don't see why it is not working since the alias is working just fine.

LaurentGom

I successfully installed and used this mod on my forum, but if I put a "big" category in one sub-forum, I get the following error when I try to access it:
QuoteQuery execution was interrupted
File: [...]/Sources/Subs.php
Line: 3315
When I say "big", I mean with a lot of posts (approx. 30000). I can put many categories and forums, it will work as long as the post count is low enough -- at least that's what I deduced from the behaviour.

Any idea to fix this?

RCC_SaMiaM

Can you please let me know where the domain is determined (what file, what function, etc) so I can try to fix this issue.  Basically where it figures out what domain is used and where it decides what "sub forum" to use.

Advertisement: