|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
! N3 l8 o( O& k- V; f1 [// Theme Option% n3 v" B5 h* b; B6 |" \
////////////////////////////////////////////////////////////////////////////////
4 i& p% C( P+ p: Q7 g2 x) |
3 P& F/ g: C) o/ C$themename = "Zenx";6 Q, \* c$ e0 w
$shortname = str_replace(' ', '_', strtolower($themename));) n/ J \9 `; q% ]; d
& _! t* U# P) g. M
function get_theme_option($option)
9 ~8 h0 `7 b" C! F X{
/ Z- B, R- F' m" s global $shortname;
% M; z: x: Y0 U) c return stripslashes(get_option($shortname . '_' . $option));
9 j' f7 [& H' s, e: W}4 O# S& ~+ Q& b/ M* o8 j1 E
+ {3 u4 y/ ^: F/ D# Z, v
function get_theme_settings($option)
9 k; x) [7 `% G# e3 q1 T{: o6 x/ j( ]* }# x* e
return stripslashes(get_option($option));/ V9 [" p$ s: u5 c8 f+ O
}. p% f/ k. d8 `2 e
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC"); {! z# P) S& `, a4 ?( H. X8 g
$wp_getcat = array();
. V' w( G5 f- O. j! B; r4 f7 |foreach ($wp_dropdown_rd_admin as $category_list) {$ p8 m4 ]# F9 l+ q6 k
$wp_getcat[$category_list->term_id] = $category_list->name;
. ~8 N. s9 |) U}
9 o1 W& _4 F2 u1 n4 @$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");/ |6 q2 w6 ^. P6 T
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");; v" }- v5 H3 u; S/ D6 e5 R
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");! ~! c2 A5 P. i+ {3 p! N
) m ]( \% d! |9 k! u9 T; k$options = array (
; N' q' Z- c5 I# g& |# w( x5 e D
9 c1 ]: _) D5 E) c# w0 B1 a( P* |2 F7 G7 j
array( "name" => "Blog Header Settings",
# O8 [7 R2 s$ J" P/ k "type" => "heading",* ?6 o- N0 D9 n8 W% l
)," s. s4 O8 h7 v8 G
9 ^! |- b3 }5 ^% e4 x1 L
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
, n4 A7 d6 z$ _" g2 f "id" => $shortname."_header_logo_activate",
' u3 j5 W- |" S, g! U "type" => "select",
- i" z2 U& l9 _0 _5 S6 K* h, N "std" => "No",) a& u8 O0 h7 q4 z# K, _- ?$ `9 ]
"options" => array("No", "Yes")),
% q6 D2 O/ h! t) _$ Q4 u& `: a8 [% F
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",! ?* W0 I6 l3 b4 a o1 d; g) c9 z
"id" => $shortname."_logo_url",
# e& r6 N4 k4 C _9 `$ i "type" => "text",
5 ~+ X0 o! j& j- x "box" => "social",
' r+ e9 Q* S' p# U" O "std" => "",
: X4 ~2 R6 x; |; X! W ),8 \5 F9 H0 ?% n7 L# I5 ?" t3 a
; C, y* c0 Y1 Y- u6 _7 z array( "name" => "Insert Header Banner HTML Code (Header)
" a( G2 u& |4 x, p <br /><em>*Recommended Size 468 x 60</em>7 b; t+ j3 b! b; s8 K9 K
<br /><em>*leave blank if not use</em>",+ U5 W" ~- C- u- y/ p: i
"id" => $shortname."_header_banner",, a. r. a+ l3 R4 S4 L. S
"type" => "textarea",' K7 ] w3 {7 Y+ }/ ?
"std" => "",
. B, D! L) [+ e. ~ ),& {: q0 s& w4 N- O
8 z% u- k: T! a2 I) s. ?+ ~* j array( "name" => "</div></div>",
' u& m! B5 e' S: b/ x$ M "type" => "close",! t: K& K' K7 W( q: C# h$ U
),, s6 A! R* g, q! x
3 G% q5 U6 \* d9 L9 ? {4 S
2 S& M# U! ^/ u& _/ Y$ m array( "name" => "Header Navigation Settings",
9 h, F- k9 b+ [* }9 l) k4 q6 p. p "type" => "heading",
; Q5 g: d! m V5 p9 w1 E ),( `( A4 a* R) W" l7 L0 [+ C- X' I0 x" z
: \- @* ` G( r6 j! T+ | array( "name" => "Insert Page ID To Exclude On Header Navigation<br />( [! X- P9 O) `" ^
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
' c5 D# Z- p3 y/ J& T" B <em>*Enter the page post ID number only</em><br />
3 [5 [( f8 |" i4 V8 ]- R+ ^0 t8 R6 f <em>*separate by comma</em><br />
9 E/ C; @/ l! k' F. i) }% @1 y) x <em>*Exclude pages which you don't want to show on the header navigation</em>",
( a" v( s2 W- K6 f- H9 T' C) z$ [9 p "id" => $shortname."_header_page_navigation",! l& z" e* M! O' g" r6 e$ n6 c& u
"type" => "text",4 G5 [* S; Y' `7 I! D
"std" => "",
* p* P( s z& F4 |5 } ),0 R" Z8 C% N% N5 y$ Q
& O+ @$ {/ G% m# y7 O! b8 t# J* d array( "name" => "</div></div>",
( m" g/ G: ~ g. |3 F7 f "type" => "close",
; Y: K0 R+ D; r1 v; R% }6 P ),4 t2 S% B) p+ m* S! y
5 ]& ~1 n0 H6 ?; a$ b
, H+ W6 L: _$ v( v
array( "name" => "Post Auto Thumbnails Settings",
6 i5 j& x! e! y+ p# G "type" => "heading",
/ x2 U |# Z$ M2 M ),( b: ~7 f" b4 l7 P0 H2 S( _4 a
9 J) B* T- }! S4 e2 ] array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
3 `* l2 c5 @) v7 o n9 \, L "id" => $shortname."_timthumb_activate",( C+ h8 |9 G7 r! B0 r; a
"type" => "select",
. h5 c/ l- B7 A "std" => "No",
7 R( @" u/ ~* c+ U7 [: f "options" => array("No", "Yes")),
; i+ D% z2 A9 _7 s 6 p1 o6 W3 m" T/ p3 X: `/ z. Y
array( "name" => "If Timthumb is enabled, Please choose its cropping method",) F" l+ X% ?: D9 Y
"id" => $shortname."_timthumb_cropping",
~- }( Z4 _0 e+ U( Z "type" => "select",( x: Z _9 {! |9 G7 y
"std" => "",
{0 z5 j) ?; \& u" W0 c( g- }6 l "options" => $crop_position),
Y% N4 j7 P/ P( ^7 g# a; O4 y1 I7 x1 F" v' [1 G
array( "name" => "Insert Width Of Thumbnail Image<br />
6 j9 D, R9 D+ d# k <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
3 @" C" X. ?2 O: P, \6 Y( W <em>*Leave Blank To Use Default: 250</em><br />",5 y- A0 S2 F! n8 W4 k
"id" => $shortname."_thumb_width",
5 u4 ~$ H3 D/ B/ C& Z# s8 T9 k7 \ "type" => "text",
# z$ f! j$ q2 G "std" => "",
0 Y! f- p# B% l0 @ ),
6 a3 T7 }/ V4 D
9 A9 i: d2 T& P( r; N K array( "name" => "Insert Height Of Thumbnail Image<br />8 n. o& t( o/ E' v! Q8 S
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
0 k. n/ ? V! O U <em>*Leave Blank To Use Default: 200</em><br />",* @3 i& }+ U5 d& M9 J
"id" => $shortname."_thumb_height",+ K" Q& s! p& ~% F# G8 [0 j
"type" => "text",
, F2 t% Q0 h) n; ? "std" => "",
# c/ W% |2 n: t9 r5 S ),1 e) L$ W; R& Y! J6 c/ Z4 m, D: X
! q( I# a! Z/ `" B* `
array( "name" => "</div></div>",4 x& }, E' G6 j: V
"type" => "close",' h8 T6 R h/ h* F8 {
),
, }9 J- {# v2 Y: ~8 k" Z `/ D3 o$ t3 H3 p. ?9 q
array( "name" => "Featured Content Slider Settings",' t1 }. x5 g2 D% ^) n
"type" => "heading",
7 k8 W* B$ l6 X: E' c ),
7 h: Z+ j' _$ `, {5 a0 G3 _' u- F* Z) L1 N5 {3 F
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) ^5 t* i1 x& P# c "id" => $shortname."_featured_activate",2 d# F( {+ x" R1 `: X% Q
"type" => "select",4 Q1 u0 S0 J7 Z% U" U
"std" => "No",
8 ^" d! {$ \& M, x3 T8 n "options" => array("No", "Yes")),. k1 W3 _4 m# m# Z+ J+ i) \; }) D. P
4 x1 i" y, s, ^. N' T4 W. u% G
% g' \7 u. G. C" V0 }! F4 n2 l1 q array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?"," H& t+ Y: G7 \: _& }
"id" => $shortname."_featured_category",
& v# m$ F% S1 X4 Y! X& f8 l "type" => "select",
8 y5 c" l( I0 m( G' C# J0 j# y) o' S "std" => "Choose a category:",
& V5 v0 ~+ S, C1 i) A "options" => $wp_getcat),
# Z7 ^* q2 A: ^7 q( }' `, x6 C, Z
% a: s% X" ?7 a0 Q7 w! \ array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
0 c# o' b0 c) q* V "id" => $shortname."_featured_number",
f! L' N, I7 a: X6 m# x8 l8 \& S, C "type" => "select",: R5 m3 {6 a( S8 \ ?1 ]' X) ~
"std" => "Number of post:",; y0 g5 B% U5 S: v; B
"options" => $number_entries)," G1 Z8 k* Y% b1 q: V+ ]& W" K' I5 q
1 ], `' O l& x5 K+ K. b8 n array( "name" => "</div></div>",, s, c8 \5 |1 h# z
"type" => "close",
: h7 g s8 x5 B6 r& P8 M1 g& Y" s ),& j; s3 _' }7 v7 s6 r
0 N( H# O1 A/ y& D array( "name" => "Featured Category Settings",) C: r' {, O5 l- a4 i9 j, }: p( ^6 I- b
"type" => "heading",+ O) m4 j. u, [
),
9 y K1 Y2 ]$ x$ _" v
5 d& H5 c. A, R" J array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% b5 _7 m* K6 G! W- \ "id" => $shortname."_featured_category_activate",
8 a0 H. k* g V& s9 S7 G* Z* ` "type" => "select",6 l# y+ k8 M( d) {* S; p
"std" => "No",
* E6 k6 ~% Q- l' D4 ]5 \' N5 R "options" => array("No", "Yes")),
# T6 f5 a1 a) L5 r2 \
: g6 O2 _8 i) e t array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
5 t* `6 s8 G9 X f9 {, _ "id" => $shortname."_featured_category_id1",
& u ^' b4 M I0 D8 G7 v3 k4 n& S "type" => "select",* ]7 T, O' |; Y1 v
"std" => "Choose a category:",
) I' k1 W6 K( Q) G0 i$ f' H "options" => $wp_getcat),
! [) }# u; O$ A: o
! e+ i- q5 f c array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
/ B, n# D0 F) r% T1 z "id" => $shortname."_featured_number1",$ l) y) G+ s" i/ _; d4 f
"type" => "select",
& n' h( Y! m( z# q& I3 m ~ "std" => "Number of post:",
$ f3 }' s) A( B% X: ?/ V* @ "options" => $number_entries),( p, {0 n$ m; ?6 X) R
% k" x: s) @/ y! d8 M3 |- S- W
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",8 x" o" z7 k2 D" y7 ~# M# D1 }
"id" => $shortname."_featured_category_id2",# ?7 r# I$ e+ J* j
"type" => "select",
4 d! ?/ i$ u% U: |2 [5 ` "std" => "Choose a category:",' t( ~0 W# @+ s
"options" => $wp_getcat),
' V" c! q8 t8 _ " [9 @6 v7 }4 F! D& M; W* m3 V
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",+ [: I( O. N6 l4 Q
"id" => $shortname."_featured_number2",
" F+ o$ c* R: z; j/ S% @+ B "type" => "select"," v# U8 C* ^9 J. f9 {4 \! v
"std" => "Number of post:",# A7 u9 V @" i C
"options" => $number_entries),
& p( E; U" U) T! d: i
" r9 F; z% v1 ]' o# m' Z4 `0 y/ o- k5 Z
. S) u- E: |8 G5 n array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
8 |7 g7 y4 C" [0 g5 u1 s "id" => $shortname."_featured_category_id3",6 T% ]+ x B5 t0 m: R' |/ G: A
"type" => "select",
$ T3 ]" {* `5 V3 c9 E$ n0 s "std" => "Choose a category:",
! ^, ~# d1 Z, o- y "options" => $wp_getcat),
; i$ |0 K5 O3 b; E8 k
8 n! D' I3 L1 S6 L8 ^! z* L array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
1 `$ u, _# Q2 s% B) _5 j "id" => $shortname."_featured_number3",# u5 V |; d* i" F. P( K
"type" => "select", Q, M' T, A M) E
"std" => "Number of post:",
! d# ~( d- f/ Y8 ^/ `6 g. i "options" => $number_entries),% A' k! Q9 U) L* M. Z) V
4 H4 S. }* H/ N& d; P% w% b* r4 f
# ?* p' z' d" Y/ S+ G2 L array( "name" => "</div></div>",; j; |6 d1 n8 A6 ^
"type" => "close",
9 o2 U: D$ u+ Y9 e8 i ),
! e5 G9 C) f5 W! t) J6 l) c" \3 a3 @" f' `" `
0 _. B' |2 o4 H: @& V
array( "name" => "Google Adsense & Analytics Settings",* a8 C& f3 I6 F# Q) F5 F
"type" => "heading",
+ N' k+ ?( H- B5 J4 m" f ),
' R8 }6 _$ G' `4 @4 n9 {6 ~1 {5 ] G- i4 b7 L5 L& u" W
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",( }& [0 U9 y9 v' E* h
"id" => $shortname."_adsense_loop_activate",
& R( Q5 m$ ~8 J- ^% m( ? O "type" => "select",
/ p4 n# q0 W1 u "std" => "Disable",
! z8 O Z3 w1 P/ d+ i) c+ j8 s "options" => array("Disable", "Enable")),
, A. ~) O$ y! e, C' m$ K, K3 B
k' F9 W E# T% q- z1 W' D array( "name" => "Insert Google Adsense Code For Loops Here<br />
/ c: K. Y) r; C' Q+ f4 |+ L/ x <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
1 y0 S! @- b% P9 r% O0 Q7 ? "id" => $shortname."_adsense_loop",
+ q6 W: Z& o. R. n4 E "type" => "textarea",% K. h7 a( t7 p* T$ V4 K3 j$ `
"std" => "",
* g7 q8 ]# ?1 U ), @2 c7 {( G6 O* E
8 A: x' _& G+ T' ]- a array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
! ?8 i9 A* g0 a% X4 A6 g "id" => $shortname."_adsense_single_activate",' Q% \' P2 i, w0 |4 ^1 ]% B% c
"type" => "select",
' B3 l! r/ k( Z" ^% }6 z" a! n9 u "std" => "Disable",6 |% |) W6 ?" I N
"options" => array("Disable", "Enable")),7 j$ x/ S! [4 y9 S2 u
; U' N' Z8 {5 _) q8 A% x6 M4 `3 `
array( "name" => "Insert Google Adsense Code For Single Page Here<br />8 K8 Q* c1 U( C2 D) W$ B- t6 I. L
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",' o+ h, P. F/ }3 |; }' ~, j
"id" => $shortname."_adsense_single",
+ r& c1 N7 v+ O4 Z" O. F% T "type" => "textarea",
) x2 p) P. x9 N- ~1 o) N "std" => "",
; H" z* [0 ~ p! P6 K ),, p. ~4 `* Y' X* A1 w
1 L" X W c6 ?6 V( |
1 [% p: o# A6 g8 t7 j array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
! g8 ?, e0 N9 f% D7 F "id" => $shortname."_google_analytics",6 q9 [% _8 W) y* H% o3 s7 p1 D
"type" => "textarea",! R7 ~( D9 g/ X3 K' c4 n. F
"std" => "",0 h9 p; a3 E* }( J r
),
6 ] e4 ~ L0 n
& ~: d/ n7 U- J& f array( "name" => "</div></div>",3 k+ P4 U% K. A7 B9 D$ g$ K( D) M
"type" => "close",
7 l8 m) Y$ k4 b3 T8 j& Q% v! k9 Q ),
* _9 }2 Y: `, y: \- b5 ]' J4 f 7 J; w" o! z3 e) Q. B
* ^, i* o: t& x array( "name" => "AddThis Social Bookmarking Settings",1 B4 a* N, G m8 F; F$ w1 n& H: Z$ z5 ?
"type" => "heading",+ j; o; @( m7 V- b
),
: F' H% m L8 D& b) t( p( e0 z3 s" R f1 s
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em> s; f' w+ K! m
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",& v1 _; {6 J! d' _1 Y
"id" => $shortname."_addthis",
6 n+ T, V7 x2 J$ E6 y; u "type" => "text",
1 j, F7 @8 H# x "box" => "social",
: O3 }; h6 E+ c "std" => "",# k, t& P" i" t
),* c: I6 a N2 r* c2 M
" w5 `' X* u1 R: s9 T array( "name" => "</div></div>",
& R8 r/ W* ]/ G7 b, x "type" => "close",
% p6 k5 `1 j; L$ j5 t* p2 z; w2 Z! g. ] ),$ r i! ~( @9 O7 D& T( v
3 t/ d2 V; M; V2 ^1 i
6 T4 [) |0 i$ n( D4 p: W1 \9 x 7 r7 `! m+ u0 x5 D9 r! W
array( "name" => "YouTube Video Settings",. Y' m: }$ o R( k! j
"type" => "heading",
" V) m% q- b0 O2 N9 E ),0 g8 X Z9 g% `
7 J+ m% U' b. S
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>", M, Y: Q; }( p t. k! I; [
"id" => $shortname."_emvideo_activate",7 y8 q) [ a; h. [4 Q
"type" => "select",. O# s0 T) d# m& x. ^+ W
"std" => "No",
# O1 d9 J8 r' y4 Q; G8 K% v "options" => array("No", "Yes")),: G; K1 V3 i6 |9 V5 i* X3 m
+ t$ K, X: e; y1 L( L4 f array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",0 | W/ v1 i8 {7 M1 E* t/ F' T
"id" => $shortname."_emvideo",1 P! R2 c: u- t% z
"std" => "",( S/ e* {7 k; J( @+ D2 x5 p% w8 l5 H
"type" => "text"),/ Y, z( s( t: {2 @; O1 R% |
3 R- w& W9 Q) ]0 Q) k, R
array( "name" => "</div></div>",
3 u( n4 G/ X% O. \% F" W "type" => "close",
. N/ z- e6 g% m% X ),
/ i( ~6 b% V- G6 [4 {2 o3 I 1 ]# [0 w! i7 d, L, {9 V
array( "name" => "Twitter Settings",
?* ]$ B/ W! I* f0 n: z. o- o9 \ "type" => "heading",: l1 u" C/ o' P& T7 r9 J( X
),
$ n( g) q& T4 q& {. X
; w2 t8 D3 F% z _- D+ E7 ` array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",$ n$ c! y6 a8 R' E
"id" => $shortname."_twitter_activate",
6 [- t4 u7 ?: r/ s( x$ K* X "type" => "select",
' N! D; D* C8 ]7 e "std" => "No",
& y, |/ N! H- y8 S! J "options" => array("No", "Yes")),
- a# `# l& v0 d! z' ~. B
1 l' S! d9 y* ~* g5 F- Y- n/ g* j array( "name" => "Insert Your Twitter ID here
+ c$ c' L" [2 h/ ^: k( L <br /><em>*leave blank if not necessary</em>5 S _) ` j9 U
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
5 W; \% {' z! f. [3 J) {% X' w "id" => $shortname."_twitter",
1 j6 m. f0 j6 s0 j6 E% v0 M2 _7 D$ E0 z "type" => "text",% K' d5 ]0 N. t* c6 z0 l
"box" => "social",
8 E* z8 [# F& h$ G* o, G "std" => "",
9 d: p$ |' E; `2 I) H! T f# T/ W9 r ),
! b: Z+ S( h* p" \3 B6 ~2 T* ?, u# d5 Z8 K3 L0 E9 Q$ c# [, W' r6 E
array( "name" => "Enter Twitter Feed Count here2 T% P6 T0 z1 u' R& n% m
<br /><em>*leave blank if not necessary</em>
5 |# t/ W3 S' u2 b! s <br /><em>*Enter How Many Twitter Feed To Display</em>",
: y0 `4 M3 o1 [9 _6 J "id" => $shortname."_twitter_count"," F q( G, c" S6 s+ E/ g7 c- s; F
"type" => "text",# x9 [6 _+ E' F1 x6 W- S
"box" => "social",* O+ @( h; M/ q8 X. i/ S
"std" => "",7 K; f Y3 y a
),1 M8 ^6 A, V5 H; h8 C* l
! x6 l; G- ]3 J/ C array( "name" => "</div></div>",# K/ h2 W0 `: ^
"type" => "close",. X/ A, t/ a4 ]% D, e8 R- f
),3 r, j0 w7 Q, U" |1 H/ C
v x; [6 ^' m E1 q& w) I0 S) w0 R) C
array( "name" => "125 x 125 Banners Advertisement Settings",
4 p2 Q2 o& b0 S) O7 ~. F "type" => "heading",
9 k2 d7 }8 ^3 _) u" ~; ~* K: b ),
$ C& L. W3 D) q, R' V6 J+ N
# Z5 }: n- z9 L% P$ t2 C& ^+ E1 W- e array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& V [$ @4 \4 l# m( e "id" => $shortname."_sponsor_activate",6 k4 f" i3 g4 u; ]$ Z, P
"type" => "select",
+ o. T9 c& {; R3 @: i$ S! ^ "std" => "No",
9 f$ x4 W+ C% Y, T, |. m "options" => array("No", "Yes")),
: @# ~$ K% W/ B* @$ \9 m( f& e
, W N/ A3 o! N! ?+ U5 C1 `4 o* ^% ^, ?2 V; G6 u+ s; g
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",+ _* c+ z) R% j1 w! |$ ^
"id" => $shortname."_sponsor_banner_one",2 k8 ~1 m* m: e3 O# c: h' y4 F
"type" => "textarea",( `* b# Z6 Z) Y2 ^& M. n+ e
"std" => "",
5 J$ T1 [6 h7 M/ `/ @ ),
- o/ F& g9 S! c8 G0 C8 e' R$ d5 O* J% Q0 s1 l: _, w$ A
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
4 Q5 Y( C3 k+ Y0 @+ T! H7 x "id" => $shortname."_sponsor_banner_two",
& {% m/ v8 \1 r "type" => "textarea",
1 e- O; b5 M5 N1 H; O7 _& b "std" => "",% l6 ~) j' \0 g! T t
),& A2 j' l( A& {- o
, m i4 Q1 H) z% B+ D* @7 G& ` array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",' {0 i7 Y& T! E. w1 m$ g1 `+ ^
"id" => $shortname."_sponsor_banner_three",2 j* g4 o+ Y7 W, B8 J8 G! X
"type" => "textarea",
- @: Q# ]: R/ C- v( l B4 t "std" => "",
8 O" R: c% u" v2 m3 V+ r( ?2 M ),$ g4 J& y0 ~: R' V' z# O5 Z
- [& ^( W/ j4 w( c8 l array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
8 t* D( x+ I4 N* ]& y "id" => $shortname."_sponsor_banner_four",5 O8 [# n9 |' D8 J9 y
"type" => "textarea",
, l; ]& B( d7 l# V7 W( { "std" => "",5 p' m2 ~: I( [* I; f/ D; I
),5 _- p; s2 U# W/ ?$ {: B1 J
9 P& i1 v5 V) O0 _, b) L
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
/ N: j+ t" C& B7 j K "id" => $shortname."_sponsor_banner_five",3 O3 ~3 h* P4 p) [2 S8 H. O! j$ B
"type" => "textarea",
) ?. j1 `) g/ Z( U: S2 d+ B "std" => "",) z9 {0 x. x2 j
),
& A( V' y0 Q$ V, T! q
7 e# i7 f( M! X: R array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>", Z, w' \- `5 t( v
"id" => $shortname."_sponsor_banner_six",/ ^8 R- r9 g7 Q! I
"type" => "textarea",
7 E! g* D+ x( f4 f% ~1 f4 X2 Z "std" => "",
) x% R3 Y' z& i4 q9 d2 t" s }- P7 t ),
8 G( O4 c4 O8 A. N- C8 a* n: [8 v* I6 C2 E
array( "name" => "</div></div>"," f* |- y7 I8 z! W8 N
"type" => "close",
1 v3 {9 `, x% z- P ),
$ a; `8 h' ^6 ]
2 |6 t$ b* n# u9 I$ E
* F0 g) O1 ]* B( X" G' T) Z) h; O' z5 X7 q# l& V! f! l# _
);
& [' P3 B" {) C8 `+ q2 G5 k& t7 b N8 V' I, \1 K; W
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
" I7 ]. v& p* m
2 z( }5 V/ z: O1 R9 W% L/ iecho "<div id=\"admin-options\"> ";: D$ d4 ]- \% P: r
7 O7 ^( s1 s+ Y1 jglobal $themename, $shortname, $options;
& D. | S& Z1 q0 ]" ~% N4 Sif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
7 l( @$ H) p' @9 m, Bif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
) B8 ~( U/ z# K% l7 {) S?>
; Q' i- C0 ] C) h, d. {/ s& m6 _. n' J6 W' @8 n* d) D
<h4><?php echo "$themename"; ?> Theme Options</h4>: k7 w, q* `5 Z! m
( z1 s8 I9 u2 ?8 S<div class="annouce"># J* d* s5 O. }+ O& Q
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
9 s/ w3 f, @3 D" l7 V* X<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>1 P8 {/ M& X# \# n
</div>+ y# J5 K6 x3 n& c: u: L5 V! N' u Y
+ J* A! E3 x+ d V6 |<form action="" method="post">' ?/ }+ y5 I a; H+ j& H& m' N6 ]. R
. {+ _$ E4 S4 Y4 z z
<?php foreach ($options as $value) { ?>
! w- o) D0 p/ p4 K* e& X4 x% r. C m) }! M2 m4 ?5 [6 O0 p
<?php switch ( $value['type'] ) { case 'heading': ?>
+ `" U( `2 t& N5 l6 \: G" K9 ^, Y( V- b+ o, e! M; a6 p6 n5 I
<div class="get-option">: Z9 n5 E# F1 v
4 L2 O! o: _% A) o8 ~<h2><?php echo $value['name']; ?></h2>
2 M8 M+ i/ |* X
7 D8 D: y" `' c* C% X3 H5 Y<div class="option-save">4 [$ E8 s: f! ?8 ~3 O
M8 u+ O3 Q: L: {
<?php
/ Y0 Y5 v8 @3 M1 C3 Wbreak;3 R: H* f% X0 v3 [# |
case 'text':9 U) ?$ G) ~5 j) A6 @ ?, @
?>) `/ W5 E1 D# V6 b( R0 F, R
]# x* `5 O& c+ M$ O0 @/ Y% \<div class="description"><?php echo $value['name']; ?></div>) [# T; y" \0 o! {4 P. t
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
5 G7 L0 N/ d, P7 {
2 [+ V8 m5 Y+ t, Kget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
( e9 k# Z6 V& R0 y! P% @) l# S5 _0 B* e+ Q3 t6 Y" {
<?php
+ T& x) C8 H9 U9 |- I- Nbreak;
& l% d; g, P- w# @7 f3 mcase 'select':, T) a; f4 C! }/ t
?>( F# A" f* o g+ F1 ]/ l: c1 D
; z3 S$ ^# u3 b' O* |' S- d
<div class="description"><?php echo $value['name']; ?></div># ^$ p# ^5 [$ G: X4 W- g
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
, Z5 N% ~' Y, q1 `" y<?php foreach ($value['options'] as $option) { ?>
0 T3 S# f- Y* t! @8 l8 B<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>! @+ l% ^: S0 j* ?; |9 w$ W$ r( C
<?php } ?>
1 L$ ^4 f1 h# N</select>1 x: h: V o0 q* C7 o7 ?1 f5 A
</p>3 Y* T1 B' A4 p* g" V- J
9 D" M/ a5 ?' \! t, B3 _<?php1 X% w% u3 f* f5 @& T- P, p" r
break;
% D1 L; @/ P. jcase 'textarea':- |6 i! h; g5 ~: M8 ] A
$valuex = $value['id'];
8 X2 t. ^/ U# `% f6 H+ n' x$valuey = stripslashes($valuex);
9 V* q: J: l+ T$video_code = get_settings($valuey);
3 ~' r: i5 B- l7 L?>0 i8 G+ o& Z/ C3 ^/ a
! o# b/ q+ i: t' l
<div class="description"><?php echo $value['name']; ?></div>
1 t* R4 g- @. o: K l( [<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
' D+ S* E0 Q/ C; J6 ?/ |) f' e
" \& K9 x- I G4 O4 ~4 Welse { echo $value['std']; } ?></textarea></p>
' E/ j, K* l$ d, s' y
4 ^4 Z o8 W9 m U' }9 R7 b( g<?php
" v; ~1 a$ Z% r. bbreak;: M, R3 z! Y$ Z; v* d( W
case 'close':
0 F2 o3 T4 P) @?>
& s3 C3 R1 V5 N/ s( E8 Q, K3 j9 e1 a/ G$ v$ j! u5 `) w
<div class="clearfix"></div>; W. \) O% y6 d7 {( q* p5 x
</div><!-- OPTION SAVE END -->* O! }: P6 f/ q# }1 `/ P1 u
4 e( `$ X3 e b9 I2 t
<div class="clearfix"></div>2 E8 e$ ]# p- y& Y& ^; n# Z
</div><!-- GET OPTION END -->9 S: F# Q$ G3 W
6 `1 I* o% x1 z7 t; p
<?php. C; K' Y2 b$ ?( {
break;6 _" V8 |+ G [/ Q2 m6 {( n2 A
default;
* y$ v: z. X( V+ Q( R0 w?>0 T& j2 I0 O& N2 `
$ v: a0 T9 o+ w, p4 Q( r: J
/ A; Z: ?1 w+ Z& |7 l<?php( W6 [( i5 s8 Z+ V+ \
break; } ?>
% L5 S9 b# W; `. Q0 o% w! {
2 @" `- s4 Q6 f, j5 G+ _3 j1 H<?php } ?>: [# F+ Q& B* m8 Z) g
+ X" N7 C K- V. x D# i- X6 N2 O% j1 P<p class="save-p">
+ p. N( g0 }! x& r<input name="save" type="submit" class="sbutton" value="Save Options" />8 f- u0 C0 @- P; v
<input type="hidden" name="action" value="save" />
' z) h& b: U. Z" B8 j</p>
, i& K) H+ J$ C2 q5 ^</form>9 q' O. |1 l7 ^4 ?% l
+ [( U! K( A5 Z6 i' ?
<form method="post">
9 V( X; q% I+ W+ R: ^( ] D+ ^* ?<p class="save-p">
$ s+ g& E; F; x( [0 U% D/ s6 H<input name="reset" type="submit" class="sbutton" value="Reset Options" />- t& A+ b( @" b$ L. m
<input type="hidden" name="action" value="reset" />
9 `. |7 L7 ^- ]- e& J: X# p</p>
; G8 G+ z! \) _" F</form>
9 s1 G) V9 y# B s- @2 E- X! o! p* g: A2 p1 ~6 D# L& C: u
</div><!-- ADMIN OPTIONS END -->0 ]! w$ u, b+ E, p6 P. t2 L, K- ^" {
/ E3 p7 o0 F3 H( D, d9 ]
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }8 d" X( \9 C* V9 E" Q$ S
4 X5 x) `; l8 e% }* K1 jfunction mytheme_admin_register() {
\6 i$ M' o2 Bglobal $themename, $shortname, $options;
- P9 N+ M& Q9 {$ p1 T0 y9 ~if ( $_GET['page'] == basename(__FILE__) ) {/ {& U5 R0 P: a2 f9 P9 d
if ( 'save' == $_REQUEST['action'] ) {
* P5 L8 w. i8 e0 A0 Kforeach ($options as $value) {) i2 l* g: Z4 \- F7 B9 O
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }6 T7 o' U9 G- W2 ?+ D9 y. v3 Q. E
foreach ($options as $value) {
3 a6 R& P8 Q- yif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
. [9 _& G1 f) uheader("Location: themes.php?page=functions.php&saved=true");+ M, h6 ~$ g K# E; k& K7 Q0 z
die;8 N7 U6 u* Z$ y
} else if( 'reset' == $_REQUEST['action'] ) {7 z5 ?: D1 t8 C% m& o& N8 g, e# I
foreach ($options as $value) {
5 J4 [: Z0 `( i2 H; N; l# b/ Idelete_option( $value['id'] ); }
~& Q# ^; V& u7 F. l% }header("Location: themes.php?page=functions.php&reset=true");
1 T: R" w; |( J+ ?. O C; N+ udie;
6 R2 X# c6 b. N$ p5 K8 y8 U}- ~( ^8 m4 j7 q& M' o! g% J
}
( u8 p# d& q; D& vadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
5 F( f3 @. O2 M# C5 T8 C}
. w! n' |( W6 X& C7 m
; ? H& y- m3 G6 |function mytheme_admin_head() { ?>/ V W/ I8 e, q% ?* a5 N
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />1 H. K- q; Y! h9 g# a
<?php }
$ M. C4 X" i9 _ |
|