vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Change Find about (https://vborg.vbsupport.ru/showthread.php?t=297236)

Adem GEN? 04-15-2013 03:18 PM

Change Find about
 
Hello,

Find and Replace via plugin

Template: bbcode_php
find: <code>{vb:raw code}</code>
replace:
<vb:if condition="$show['member']">
<code>{vb:raw code}</code>
<vb:else />
Show this to guest only
</vb:if>

How do I?

Thanks

Lynne 04-15-2013 03:25 PM

Why not just edit the template? But, besides that... have you even tested it to see if it works? You would need to have post caching turned off, I believe.

http://php.net/manual/en/function.str-replace.php

Adem GEN? 04-15-2013 03:51 PM

Template with editing works, no problem

I want to do with Plugin, Is it possible to make?

Lynne 04-15-2013 05:46 PM

Could try something like....

hook location - bbcode_fetch_tags

php:
PHP Code:

if (!($vbulletin->userinfo['userid'] > 0)) {


$tag_list['no_option']['php'] = array(
                
'html'          => 'No viewing allowed'
            
);


(You will need to test it and also replace the html with what you want.)

Adem GEN? 04-15-2013 07:06 PM

Thank you very much,

I have a question,
Is it possible to show in this way? http://awesomescreenshot.com/08a160hp88

Lynne 04-16-2013 03:25 AM

You can enter the appropriate html to make the textedit box like in your screenshot. Just get the html from the source code.

If your code doesn't work, post *exactly* what you did so we can test it ourselves and see what is going on.

Adem GEN? 04-16-2013 03:48 PM

For registered members
http://awesomescreenshot.com/0ad165ic85

For guests (plugin, with your code)
http://awesomescreenshot.com/046165it9c


I want it like this, but I could not
Could you help me, I am not experienced.
Note: With editing template
http://awesomescreenshot.com/0c0165kd1f

PHP Code:

if (!($vbulletin->userinfo['userid'] > 0)) {


$tag_list['no_option']['php'] = array(
                
'html'          => 'No viewing allowed'
            
);

$tag_list['no_option']['html'] = array( 
                
'html'          => 'No viewing allowed'
            
);

$tag_list['no_option']['code'] = array(
                
'html'          => 'No viewing allowed'
            
);


Thanks

Lynne 04-16-2013 09:28 PM

Take a look at your page source for the page with those tags on it. Then copy the divs you want around it... something like:

HTML Code:

<div style="margin:5px 10px">
        <div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
        <div class="alt2" dir="ltr" style="
                margin: 0px;
                padding: 4px;
                border: 1px inset;
                width: 650px;
                height: 130px;
                text-align: left;
                overflow: auto"
>

stuff
</div>
</div>

And add that into the code code with "No viewing allowed" replacing "stuff". It will be slightly different for each $tag_list item.

Adem GEN? 04-17-2013 07:13 PM

Thank you very much, okay.

Adem GEN? 04-18-2013 07:49 PM

Hello again,
I have a problem, Can you help?
What you need to do not hide in the archive?

Also tag ['video'] not work,
Whats wrong?

Thanks

Lynne 04-18-2013 09:37 PM

You don't want to hide the code in the archive? Those pages have THIS_SCRIPT defined as 'archive' so just add that into the condition.

As for the videos.... those don't show in the archives and I would guess you would need to go actually edit the code manually to make them show.

Adem GEN? 04-19-2013 08:08 AM

Quote:

Originally Posted by Lynne (Post 2417236)
You don't want to hide the code in the archive?

I want to hide.
I hid URL Links into Archive. That's OK.
I want to hide [php],[html],[code],[quote] into Archive.

Quote:

Originally Posted by Lynne (Post 2417236)
Those pages have THIS_SCRIPT defined as 'archive' so just add that into the condition.

Can you give an example? I'm beginner.


Quote:

Originally Posted by Lynne (Post 2417236)
As for the videos.... those don't show in the archives and I would guess you would need to go actually edit the code manually to make them show.

Not the archive
Okay video. I Changed $tag_list['no_option']['video'] => $tag_list['video']['php'] now ok

Thanks

Lynne 04-19-2013 02:45 PM

if (!($vbulletin->userinfo['userid'] > 0) AND THIS_SCRIPT != 'archive')

(I'm still not sure what exact condition you wanted there so you will need to do the logic yourself.)

Adem GEN? 04-19-2013 04:15 PM

Section the normal message
http://awesomescreenshot.com/09216n9j50

Archive Section (The problem here)
http://awesomescreenshot.com/0d016nak95

For Archive [url],[video],[img]
archive_thread_post
PHP Code:

if ($vbulletin->options['adem_bbkodugizleme_etkin'])
{
if (!(
$vbulletin->userinfo['userid'] > 0))
    {
$post['pagetext'] = eregi_replace('(http|www)([[:alnum:]/\n+-=%&:_.~?]+[#[:alnum:]+]*)'$vbphrase[adem_arsiv_url_mesaji], $post['pagetext_simp']);

$post['pagetext_simp'] = strip_bbcode($post['pagetext']);
$post['postdate'] = vbdate($vbulletin->options['dateformat'], $post['dateline']);
$post['posttime'] = vbdate($vbulletin->options['timeformat'], $post['dateline']);
    }


I want to hide [php],[html],[code],[quote],[email] into Archive.

Can you help?

Thanks

Lynne 04-19-2013 04:33 PM

I'm not really sure... but it uses the function strip_bbcode which is in the fuctions.php file. You could try using the hook strip_bbcode and set $fast_and_dirty to true? I'm not sure what that will do, but take a look at the function and you can probably do what you want.

Adem GEN? 04-19-2013 05:39 PM

I'm sorry, I am taking your time so much.

I want to write a plugin.
Task of plugin is hiding [php],[html],[code],[VIDEO],[quote],[IMG],[url],[email] tags from guests.

I can hide in the forum with the sample code you gave me That's ok, no problem.
hook location - bbcode_fetch_tags
PHP Code:

if (!($vbulletin->userinfo['userid'] > 0)) {

$tag_list['no_option']['php'] = array(
                
'html'          => 'No viewing allowed'
            
);


The screen is here:http://awesomescreenshot.com/09216n9j50
Thank you



But I can not hide [php],[html],[code],[VIDEO],[quote],[IMG],[url],[email] tags in archive. I need to help here, Could you help me, please? Can you give an example? I'm beginner.

Regards

Lynne 04-19-2013 10:33 PM

Ummmmm, hook location strip_bbcode:
PHP Code:

$fast_and_dirty true

I'm honestly not sure if that will do exactly what you want but it's worth trying. Did you go find the function in the file that I mentioned? Take a look at it and how it defines the parameters, like these defaults:

$stripquotes = false
$fast_and_dirty = false
$showlinks = true
$stripimg = false
$keepquotetags = false

So, try setting those to what you want and see what happens.

Adem GEN? 04-20-2013 06:00 AM

Thank you for your help but I could not


http://awesomescreenshot.com/08816pf234

Lynne 04-20-2013 03:28 PM

I'm sorry, but if those don't work, then you will need to actually look at the function I pointed you to and try some things out yourself. There are already mods to do all this stuff and I don't have time to go and see how they did them, so you should go do that.

Adem GEN? 04-21-2013 06:09 PM

Thank you very much for your help again

I couldn't find plugin for 4.x.x version. (hiding the bb code from guests.)

Can you allow me to ask other persons by opening a new topic?

Best Regards

Lynne 04-21-2013 07:29 PM

You are welcome to ask again about it.

Adem GEN? 04-23-2013 10:30 AM

Hello again, I'm sorry, I am taking your time so much.

l'm sorry, I'm beginner.
Your Message #17
hook location strip_bbcode:
PHP Code:

$fast_and_dirty true 

functions.php
Is it possible to disable the this code with plugin?
PHP Code:

    if ($fast_and_dirty)
    {

        
// any old thing in square brackets
        
$find[] = '#\[.*/?\]#siU';
        
$replace[] = '';

        
$message preg_replace($find$replace$message);
    } 

I get my need in this way.
$message; //= preg_replace($find, $replace, $message);

Thanks

Lynne 04-23-2013 03:57 PM

If you want to disable that code, then you can set $fast_and_dirty to false and then that code won't be run.

Adem GEN? 04-23-2013 04:30 PM

When I set $fast_and_dirty=false; to false, this time else section runs.

[php],[html],[code],[VIDEO],[quote],[IMG],[url],[email] => Isn't there any way to show these tags with their contents?

Lynne 04-23-2013 04:41 PM

You mean like in the regular posts? You will need to basically write a plugin to do that that uses the same code used in posts.

Adem GEN? 04-23-2013 05:41 PM

functions.php line 2341
PHP Code:

        if ($keepquotetags)
        {
            
$regex '#\[(?!quote)(\w+?)(?>[^\]]*?)\](.*)(\[/\1\])#siU';
        }
        else
        {
            
$regex '#\[(\w+?)(?>[^\]]*?)\](.*)(\[/\1\])#siU';
        } 

How can I control this code with plugin?
Find: $regex = '#\[(?!quote)(\w+?)(?>[^\]]*?)\](.*)(\[/\1\])#siU';

Replace: $regex = '#\[(?!quote|php|html|code|video|url|img)(\w+?)(?>[^\]]*?)\](.*)(\[/\1\])#siU';
How can I replace the code above?

Lynne 04-23-2013 06:05 PM

I think the only way to replace it is to actually modify the file itself.

Adem GEN? 04-23-2013 06:54 PM

Thank you very much for taking the time

Best Regards

Adem GEN? 04-25-2013 10:36 AM

Hello again, I'm sorry, I am taking your time so much,

What hook location for Activity Stream AND Activity Stream in Member Profile?

Thanks

Lynne 04-25-2013 05:36 PM

I don't understand your question. But to see what hooks are being used on a particular page, you may turn on debug mode and they will all be listed on the bottom of the page in the order they are called.

Adem GEN? 04-25-2013 08:43 PM

See: http://awesomescreenshot.com/09a17haoa9

I know the list, So many options available
List see: http://awesomescreenshot.com/0c117hau4b

Thanks

Lynne 04-25-2013 11:01 PM

Those templates are "activitystream_forum_thread" (and other "activity_stream_*" templates) and so if I search in the files for where the template is rendered, it looks like it happens in the function fetchStream. You probably want to do a search in the files to find where that function gets called and see if there are any hooks just beforehand.

Adem GEN? 05-16-2013 01:26 PM

Hello again, I'm sorry, I am taking your time so much.

The code "exluded forums" below works everywhere but it doesn't work in "threadbit_process". What is the problem? Can you help?

Hook: threadbit_process
PHP Code:

eval('$adem_exluded_forums = in_array($forum[forumid], array(' $vbulletin->options['adem_exluded_forums'] . '));');

if (
$vbulletin->options['adem_thread_preview'])
{
if (!(
$vbulletin->userinfo['userid'] > 0))
{
if (!
in_array($forum['forumid'], array($adem_exluded_forums)))
{
$thread['preview'] = '';
}
}


Thanks in advance

Adem GEN? 09-17-2013 12:46 PM

Quote:

Originally Posted by Lynne (Post 2416541)
Could try something like....

hook location - bbcode_fetch_tags

php:
PHP Code:

if (!($vbulletin->userinfo['userid'] > 0)) {


$tag_list['no_option']['php'] = array(
                
'html'          => 'No viewing allowed'
            
);


(You will need to test it and also replace the html with what you want.)

Hello;
Can I ask something? Why doesn't the code above run on 4.2.0 version?
Thanks...


All times are GMT. The time now is 05:43 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01303 seconds
  • Memory Usage 1,843KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (10)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (34)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete