Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : claqxcrl ( 523)
PHP Version : 8.1.32
Disable Function : NONE
Directory :  /home/claqxcrl/anfangola.com/wp-content/plugins/wp-post-author/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/claqxcrl/anfangola.com/wp-content/plugins/wp-post-author/assets/js/post_author_ratings.js
import ReactDOM from 'react-dom'
import ReactStars from 'react-stars'
import { transitions, positions, Provider as AlertProvider } from 'react-alert'

document.addEventListener('DOMContentLoaded', () => {
    var root_id = "awpa-author-post-star-variation"
    var elements = document.getElementsByClassName(root_id)
    const DecimalNumber = ({ value, decimalPlaces }) => {
        const formattedNumber = parseFloat(value).toFixed(decimalPlaces);

        return (

            <span className='rating-avg'>{formattedNumber}</span>

        );
    };

    if (elements) {
        for (let index = 0; index < elements.length; index++) {
            const element = elements[index];
            var avg = element.getAttribute('attributes')

            let post_rating_type = element.getAttribute('rating_type')
            let rating_color_back = element.getAttribute('rating_color_back')
            let rating_color_front = element.getAttribute('rating_color_front')
            let show_avg = element.getAttribute('show_avg')
            let count = element.getAttribute('count')
            let show_votes = element.getAttribute('show_votes')
            ReactDOM.render(<AlertProvider>

                <ReactStars className="awpa-pro-rating-review "
                    key={Math.random() * 100000}
                    count={post_rating_type}
                    value={avg}
                    size={20}
                    half={true}
                    edit={false}
                    color1={rating_color_back}
                    color2={rating_color_front}
                />
                {show_avg &&
                    <DecimalNumber value={avg} decimalPlaces={1} />
                }

                <span className='rating-votes'> {Boolean(show_votes) ? count + ' reviews' : ''}</span>




            </AlertProvider >, element)
        }

    }

})

ZeroDay Forums Mini