[MOD] Advanced Meta Tags MOD (phpBB3)

Locked
User avatar
GoKuSaN
Membru
Membru
Posts: 137
Joined: 6 years ago
Has thanked: 0
Been thanked: 0
Status: Offline

6 years ago

Title: Advanced Meta Tags MOD
Description:Acest mod genereaza automat cuvinte cheie si meta tag-uri.
Version: 1.0.0

Intram in phpmyadmin > Selctam baza de date de la forum
Apasam pe SQL si in el intrducem :

?
1
2
3
4
5
6
7
INSERT INTO phpbb_config (config_name, config_value) VALUES ('description_word_count', 150);
INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_dynamic_description', 1);
INSERT INTO phpbb_config (config_name, config_value) VALUES ('append_keywords_first', 0);
INSERT INTO phpbb_config (config_name, config_value) VALUES ('global_keywords', 'replace, these, keywords, with your own, keywords');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('append_global_keywords', 1);
INSERT INTO phpbb_config (config_name, config_value) VALUES ('keyword_word_count', 50);
INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_dynamic_keywords', 1);
Deschidem: language/en/acp/board.php
Cautam linia

?
1
2
'WARNINGS_EXPIRE_EXPLAIN'
));

Dupa adaugam :

?
1
2
3
4
5
6
7
8
9
10
11
12
13
// Advanced Meta Tags MOD
$lang = array_merge($lang, array(
'APPEND_GLOBAL_KEYWORDS' => 'Append Global Keywords',
'APPEND_GLOBAL_KEYWORDS_EXPLAIN'=> 'Add Global Keywords to the Generated Meta Keywords',
'APPEND_KEYWORDS_FIRST' => 'Add Global Keywords Position',
'APPEND_KEYWORDS_FIRST_EXPLAIN' => 'Yes to add Global Keywords appear before Generated Keywords,
No to add Global Keywords after Generated Keywords',
'DESCRIPTION_WORD_COUNT' => 'Meta Description Word Count Limit',
'DYNAMIC_DESCRIPTION' => 'Enable Page Generated Meta Descriptions',
'DYNAMIC_KEYWORDS' => 'Enable Page Generated Meta Keywords',
'GLOBAL_KEYWORDS' => 'Global Meta Keywords',
'KEYWORD_WORD_COUNT' => 'Meta Keyword Word Count Limit',
));
Deschidem: includes/acp/acp_board.php

Cautam

?
1
'site_desc' => array('lang' => 'SITE_DESC', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false),

Dupa adaugam :

?
1
2
3
4
5
6
7
8
// Advanced Meta Tags MOD
'use_dynamic_description' => array('lang' => 'DYNAMIC_DESCRIPTION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'description_word_count' => array('lang' => 'DESCRIPTION_WORD_COUNT', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false),
'global_keywords' => array('lang' => 'GLOBAL_KEYWORDS', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false),
'use_dynamic_keywords' => array('lang' => 'DYNAMIC_KEYWORDS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'keyword_word_count' => array('lang' => 'KEYWORD_WORD_COUNT', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false),
'append_global_keywords' => array('lang' => 'APPEND_GLOBAL_KEYWORDS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'append_keywords_first' => array('lang' => 'APPEND_KEYWORDS_FIRST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
Deschidem : viewtopic.php
Cautam linia

?
1
2
3
4
5
6
// Output the posts
$first_unread = $post_unread = false;
<color=#40BF00>Dupa adaugam :

// Advanced Meta Tags MOD
$first_post_text = '';
Cautam linia :

?
1
2
3
4
5
// Second parse bbpre here
if ($row<'bbpre_bitfield'>)
{
$bbpre->bbpre_second_pass($message, $row<'bbpre_uid'>, $row<'bbpre_bitfield'>);
}
Dupa adaugam :

?
1
2
3
4
5
// Advanced Meta Tags MOD
if ($i == 0)
{
$first_post_text = $message;
}
Cautam:

?
1
2
3
4
page_header($user->lang<'VIEW_TOPIC'> .' - ' . $topic_data<'topic_title'>);
<color=#40BF00>Repunem cu :

page_header($user->lang<'VIEW_TOPIC'> .' - ' . $topic_data<'topic_title'>, true, $first_post_text); // true, post_text added by Advanced Meta Tags MOD
Deschidem includes/functions.php

Cautam :

?
1
2
3
4
function page_header($page_title = '', $display_online_list = true)
<color=#40BF00>Repunem cu :

function page_header($page_title = '', $display_online_list = true, $post_text = '') // true, post_text added by Advanced Meta Tags MOD
Cautam linia:

?
1
2
// The following assigns all _common_ variables that may be used at any point in a template.
$template->assign_vars(array(
Adaugam inainte:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Advanced Meta Tags MOD
$page_keywords = $config<'global_keywords'>;
$page_description = $config<'site_desc'>;

if (!empty($post_text))
{
$post_text = strtolower(strip_tags($post_text));
$post_text = str_word_count($post_text, 1);
if ($config<'use_dynamic_keywords'>)
{
$count = 0;
$page_keywords = array();
foreach ($post_text as $word)
{
$word = str_replace("'", '', $word);

if (strlen($word) > 2)
{
if (!empty($page_keywords) && in_array($word, $page_keywords))
{
continue;
}
$page_keywords<> = $word;
$count++;
}

if ($count == $config<'keyword_word_count'>)
{
break;
}
}
$config_keywords = ($config<'append_global_keywords'>) ? $config<'global_keywords'> : '';
$page_keywords = ($config<'append_keywords_first'>) ? $config_keywords . ', ' . implode(', ', $page_keywords) : implode(', ', $page_keywords) . ', ' . $config_keywords;
}

if ($config<'use_dynamic_description'>)
{
$count = 0;
$page_description = '';
foreach ($post_text as $word)
{
$page_description .= $word . ' ';
$count++;

if ($count == $config<'description_word_count'>)
{
break;
}
}
}
}
Cautam:

?
1
'PAGE_TITLE' => $page_title,
Dupa adugam:

?
1
2
3
// Advanced Meta Tags MOD
'PAGE_KEYWORDS' => $page_keywords,
'PAGE_DESCRIPTION' => $page_description,
Deschidem: styles/TEMA TA/template/overall_header.html

Locked

Return to “Mod-uri”