|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
3 I' L( |; i C4 g2 x* ?7 L// Theme Option! [9 {( _3 k& E& M9 h
////////////////////////////////////////////////////////////////////////////////9 ^) }, L/ \3 i4 J" Q
8 V3 o9 u# w) F8 k( l$themename = "Zenx";) v/ {1 E8 O' w# a) b+ c$ R
$shortname = str_replace(' ', '_', strtolower($themename));% A) H3 R6 A3 G$ T4 s% P9 W
' H9 ^' Y. @* z7 T- c
function get_theme_option($option)* x' ~5 V l5 h/ L' G( {
{
! u/ }0 j7 H3 u; D' C5 g global $shortname;# A3 V( m }! q) z, t2 A
return stripslashes(get_option($shortname . '_' . $option));
c6 C F# ~$ {3 t0 J& ^}
; ?' p* v+ p( X: A& j( w2 O' j
1 A; y) M* B% c6 i, t* G; pfunction get_theme_settings($option)2 d- c- ?! x5 M t
{
) ^4 Y+ M: Z1 Y/ d$ U4 ]& K* n return stripslashes(get_option($option));6 m& W4 y9 f: X) }+ [$ Q+ h
}
7 J; f5 B6 M5 \( M$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");) l% n4 e$ l. i, U8 [# A
$wp_getcat = array();
% Q3 T8 b0 u3 L4 A+ oforeach ($wp_dropdown_rd_admin as $category_list) {9 o: Z; q, P" h- N% {: M r* L
$wp_getcat[$category_list->term_id] = $category_list->name;
9 }/ i' m3 k3 G% e: y) n. c}
, n2 |0 S, u- a3 R" M( [* g8 ?$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");; u. |- U7 e0 |& y. f
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
+ h5 p& n3 d* L3 @$ J$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");4 l9 r) P7 D5 ?0 l6 y
# o3 ~' ^4 x* v6 O4 S3 N' o% J9 x i
$options = array (
4 s4 b8 [1 ^/ ^; A/ N: j) G/ e9 q# g- h, q
9 u& S6 l; J3 `% ]) _$ v, M array( "name" => "Blog Header Settings",: N, N; |0 ?- w* |( }0 G$ I
"type" => "heading",# j! n7 q( J: w
),
, a: T" @7 [! s S; ~6 I
& Q, u# T- h% o# k0 t! s( E! | array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! k. `' Q. u' u) r; W "id" => $shortname."_header_logo_activate",* k% Q# T$ T0 y$ L3 F) C$ d
"type" => "select",) O( m2 p3 P/ f( M
"std" => "No",
k0 x" C& C# n3 ~ "options" => array("No", "Yes")), F5 l- m" |4 F3 N3 Z: c: d
: l3 ^. B* V6 @( _ array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",8 Y! Q, q$ ~! E9 B& b
"id" => $shortname."_logo_url",% X6 p/ ^) I, B4 T8 x
"type" => "text",2 D+ l0 A& q* w% S8 d
"box" => "social",
8 e, v3 A$ e& U. r. r "std" => "",
- [" M& J7 R9 _. Z& X9 n- v/ P, ?4 f ),
6 o' U- R6 o( _) z $ ^$ a! p" p" J. W6 H7 n
array( "name" => "Insert Header Banner HTML Code (Header)) y4 B9 j Q+ i8 e5 o, {
<br /><em>*Recommended Size 468 x 60</em>
) c% e7 [/ A! ?8 T. `) u( s <br /><em>*leave blank if not use</em>",
- Q" x- u( P7 l U "id" => $shortname."_header_banner",. g2 o0 g2 U! s& R o9 K
"type" => "textarea",
: z. p0 m3 ~' @# g "std" => "",# {/ s% [% \" i# B9 f I/ }
),
6 b' A: [* _5 d# P* J* S. p3 J3 I& z
; n( @! q0 u5 z+ T4 ? array( "name" => "</div></div>",! D" m t! o$ |! m4 m2 l
"type" => "close",* Y+ \; K- w- H7 r6 @+ ~' E
),
, j, R" v- a/ C7 O' A( r; H
6 V/ T5 ^' O* E* l0 y& n# w2 u& t0 J* k: H
array( "name" => "Header Navigation Settings",
& T# }6 C2 ]$ k% j3 K& G "type" => "heading", ?$ P4 {) m; `5 W/ u+ @
),
2 [1 z& J/ g4 d& s& `! ^5 S
; g/ |' z* I3 m3 q+ B$ \$ N array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
+ I2 ^' I/ {+ I3 J; U* P <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
- \ G2 d6 S7 z. ?- k7 U <em>*Enter the page post ID number only</em><br />
$ Q0 K. Y: N/ o. L7 i <em>*separate by comma</em><br />6 |5 |7 A1 v r0 F3 p# O
<em>*Exclude pages which you don't want to show on the header navigation</em>",
1 W& L1 F/ x( d0 L2 C" e "id" => $shortname."_header_page_navigation",2 [/ |, l3 L5 F
"type" => "text",2 V9 a6 V `0 ?: ?) m# O7 A9 h
"std" => "",0 r& }' B+ o5 J4 h. ?
),* `0 g: h0 E/ A& _" w
( {/ }# T# p1 y
array( "name" => "</div></div>",' e+ d& G+ K# {) L6 e6 P& }1 U7 B
"type" => "close",
( x0 k3 w5 Z5 b% W ),
- ^+ d% x" x3 H- y, s$ P8 ` 8 |! @- E" Y2 o L0 D5 Q# ]# [
* Y4 D* o, [/ \4 I# {) s% F array( "name" => "Post Auto Thumbnails Settings",0 o2 b2 G R d, p5 E8 F
"type" => "heading",
- f" l. T) A3 c7 Q H, n) c ),
- o" J+ ~) X b) o0 L5 F9 }
9 a+ F. `& z, e. j7 N array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",- d: j5 [! S' y. P6 Q0 X; T- c& e
"id" => $shortname."_timthumb_activate",
+ C8 x- \1 m1 L' F "type" => "select",* A2 d& h2 E( W G- c1 T. \4 b
"std" => "No",7 z& d% L% K. U4 q+ { Y
"options" => array("No", "Yes")),
. u$ i3 M# N T! \# Q
& t) X% x2 t9 G- O- ]" m1 D7 N array( "name" => "If Timthumb is enabled, Please choose its cropping method",
! U' @" x. Y a& e% s "id" => $shortname."_timthumb_cropping",
* d& O+ x+ X: I1 |7 D1 z "type" => "select",
6 k: f+ W" {/ v; E: { "std" => ""," U- _8 x& D* j' [1 y# G
"options" => $crop_position),
* h2 `0 R6 u' h2 ]+ P( Y
0 n* ^7 J2 K3 l: ?6 W) [# S2 C array( "name" => "Insert Width Of Thumbnail Image<br />
' F1 W# h) L/ I/ W; u% B; H1 s0 S <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
x* I. f: f$ e- C' w4 h <em>*Leave Blank To Use Default: 250</em><br />",
0 w3 I' U$ o" Y, P "id" => $shortname."_thumb_width",+ F0 o7 _ ^# B& E1 ^+ Y$ S
"type" => "text",
# q. n+ ^5 Z! y# X "std" => "",4 G% i" `+ a' e& o* r
),
- a7 U9 l) \6 v
" S: Q! A* B: V3 E1 X4 S array( "name" => "Insert Height Of Thumbnail Image<br />1 B) V6 [$ C+ M" o# \) r& k: a
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
$ Q; \; }9 w0 C <em>*Leave Blank To Use Default: 200</em><br />",
) ?; k; K) Q3 }, ~* D "id" => $shortname."_thumb_height",
: T3 L& @& Z' u& G "type" => "text",
D) V7 p- w! E "std" => "",
; s, D' f8 V* [4 V, O ),
7 `" D( `5 h2 I5 |: \9 u
/ x4 K) |& P' ?9 C8 G5 t5 b array( "name" => "</div></div>",5 F) ]5 P+ {9 w6 j2 p5 D
"type" => "close",
% }* j" a" f$ _. R9 Y' S( f" z, A& ] ),# e1 X8 z" Q/ c( ]; U# Q/ N
- E& c8 X! ?: ~' p1 o& i array( "name" => "Featured Content Slider Settings",2 Y1 }+ Z# {3 m/ P) i9 S
"type" => "heading",; l" b' A6 {8 g f* D6 q, e
),% D6 Y2 E) Y6 G; x
+ o* O9 X1 ], W4 R! t1 |
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",+ a* f* Z+ a, T5 `
"id" => $shortname."_featured_activate",# K* S) U& l5 D, K' h
"type" => "select",) I' }8 L6 b. M& P8 u
"std" => "No",
/ r' V9 w* @- U" \ "options" => array("No", "Yes")),
& V& P8 f$ z6 |4 ]9 Z# \% v
6 u* a$ ]2 w4 {! P. A. N& T
+ O6 e8 p& E* ]+ [ array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
; r# K5 O" Z" J) r4 g* y7 o/ y "id" => $shortname."_featured_category",
! g$ T* T5 z2 H: e* G" z9 d# D "type" => "select",
% e5 {7 ]; s6 ^" |2 p3 g "std" => "Choose a category:",6 D3 @' E4 |" r& F3 G/ h, D* m( ]
"options" => $wp_getcat), z' q( ? U; A* Y/ w* }+ j/ ~* o/ o
0 p! c/ s+ v5 S- G, g8 t array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",! J: ^" q S) B, Y7 p
"id" => $shortname."_featured_number",
. O- g7 T# c; \* P& M7 z "type" => "select",
# S9 m3 Z% R+ d# x3 f8 j {3 W "std" => "Number of post:", R+ S8 ?- T6 h: s" ?
"options" => $number_entries),
7 [1 U8 p, g* e- j1 O% Q4 Y1 y3 }
" q0 S# b) c8 ]7 Y. O4 G. |/ n array( "name" => "</div></div>",5 i# j, d+ f) z, W
"type" => "close",
( D% T6 v' s' }6 o" y9 O( E ),
2 Y D4 T/ h4 ?7 ` l 3 {& Y8 z" K; n* t6 i( T
array( "name" => "Featured Category Settings",
$ \9 T+ s( k4 w' z. A "type" => "heading",$ }9 `3 L9 }" h1 J) `
),; H$ D3 l4 p6 t4 _ d/ {- f: D; c
0 Y6 j8 T' \0 |0 f2 s: R array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) K$ e8 x) `! b+ d
"id" => $shortname."_featured_category_activate",
& L/ d9 p& t9 E2 }. J "type" => "select",2 l( T L- a0 H/ H1 M7 m' Z" h
"std" => "No",
+ S# m5 Y6 C- S2 G8 O "options" => array("No", "Yes")),6 y w1 l) o1 z7 o; u) w. S
. D% ?) T0 B; C. U* `$ ?2 s1 N
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
$ U# y; F2 J5 N "id" => $shortname."_featured_category_id1",1 ~1 ~7 R, g9 R" z" p0 _
"type" => "select",
* a. R- F# p+ m* d+ `+ o% E' A7 g# u "std" => "Choose a category:",) k) \+ I! J8 Q7 O" o2 M6 I( A& f
"options" => $wp_getcat),
5 P, Q3 M t' O0 F4 c+ r
' L3 c, L; k A array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
; H3 T3 D4 f6 l* Q6 n+ }( q# v$ j "id" => $shortname."_featured_number1",
' m. u* ]* R% p- G; \4 u "type" => "select",/ q5 b) W, Z# m. h; m7 o) Z- l0 G
"std" => "Number of post:",' W( \2 ?7 q2 Q1 Z; y/ e
"options" => $number_entries),
' y4 h% f+ o c: o7 D W9 ?% a
( O6 q' F$ T: f0 \9 p# H array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
5 q; ^ _8 r/ Q d# N "id" => $shortname."_featured_category_id2",
. d+ g ^- i- W$ @ "type" => "select",
. E& s; J% W. X% M1 l9 y- c "std" => "Choose a category:",' C2 W, X% f5 l" V
"options" => $wp_getcat),0 i5 I1 Y5 r2 S
5 f. R5 u. r; \9 ^8 K- ^/ @! H
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
- s; `" f6 [0 p% ` e- @ "id" => $shortname."_featured_number2",
t; Q7 ~1 b* J B* x5 S# l "type" => "select",4 W! X" ^7 L% K, |
"std" => "Number of post:",
9 e: v2 [4 \1 G "options" => $number_entries)," d$ t0 ?5 \8 `# p
+ a7 D: p6 ]0 D
8 S8 V+ y% ?- J
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",: N1 g7 j. V; k( T
"id" => $shortname."_featured_category_id3",
$ S, V( r7 `6 y$ b$ O8 v- Y0 C4 C "type" => "select",
; D6 a$ z' Y9 ]$ Y' E "std" => "Choose a category:",
+ t# _* a1 E& ?* Q; p$ [& H% w "options" => $wp_getcat),
5 ?0 q/ ^4 C A( X) m. D
1 ?: z" I" R4 W array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
5 P/ E) P' o# Q3 @: c "id" => $shortname."_featured_number3",
6 l+ B0 ~ M% h! K5 b% p3 f, c: i "type" => "select",; M. q1 m3 h* s
"std" => "Number of post:",5 }: ^' j) H/ j/ R; p% i
"options" => $number_entries),
v0 V1 u5 H6 Q& X8 A) Y6 W f, B! R4 A
" E" U% X2 |" o$ Q0 Q S" u
/ B+ V0 D/ K+ Q" D5 d! P array( "name" => "</div></div>", {% [) \8 ?7 b9 B( C3 o
"type" => "close",4 N2 \5 b. _' x0 o1 q8 @% \' C
),
8 C* l/ k5 n+ p; Q) @, m( S7 V% L6 S
) _, K0 N% A& U7 M$ z6 }. }& V0 l! g array( "name" => "Google Adsense & Analytics Settings",0 y# j/ Q" Z8 D* m0 b
"type" => "heading",
: i, M/ n, o% N9 Y' n+ L* V2 ` ),
" k/ a) z, K; e9 }' |! {: o* g0 i6 Y; R* K* Z" c ?% E8 |) W
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",; N4 M3 w' \' p- g F/ ~/ Q
"id" => $shortname."_adsense_loop_activate",
" B8 K8 R9 b- ~5 U' ~9 p "type" => "select",
# t! m* l9 X: d6 W "std" => "Disable",
6 E1 _5 H r" I; P, m" R "options" => array("Disable", "Enable")),
* \2 ]7 _5 F. ^' x4 ^: U9 f8 O1 G7 _4 j9 O2 [5 ?
array( "name" => "Insert Google Adsense Code For Loops Here<br />& D/ `/ V5 h9 ~: [
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
) j4 Y7 |" R: ]: q: V- X# h# S0 ]* ` "id" => $shortname."_adsense_loop",- p9 `/ [: _( e* T' A
"type" => "textarea",
$ c) Q+ y! R% ^9 d/ I "std" => "",
5 i6 J% E2 H! l- z2 y6 X- z3 Y$ M" H ),
; {) E, g2 `1 i/ `1 A- R& O# J) m1 D! G; J
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
7 P' ]4 ^1 p! k: e: } "id" => $shortname."_adsense_single_activate",6 K3 _- O9 c% S- F0 L$ L% R! R
"type" => "select",% z- X T3 S2 z( w2 g
"std" => "Disable",
" n; X% O: g( C4 P "options" => array("Disable", "Enable")),
$ |0 a' D+ `0 N: I
/ p$ O; m9 q8 ]; A( U array( "name" => "Insert Google Adsense Code For Single Page Here<br />
, I' W5 }9 U8 O8 Z0 \& R3 U, n& _ <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",! e+ F$ Z' x, X' v4 V" ]$ s" ]
"id" => $shortname."_adsense_single",( X7 N) @4 i6 u9 s0 |6 N: B3 g
"type" => "textarea",9 l" z+ Z3 y$ }) t
"std" => "",
5 |2 V b2 S: v" ?" n ),
6 N4 J, _# k( c( S- R/ [4 l0 v' k+ z5 R
0 w) M9 K' b- k# z9 t: z
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",) q* W j" p( e
"id" => $shortname."_google_analytics"," ~5 J8 { _6 i: G {# ~( E. G% y
"type" => "textarea",
; p! V' V) D& J( d9 \. o) a$ p "std" => "",7 f% R+ K$ {9 r0 |( J
),
6 S( s% }- D" `- h% `
7 w& O* B. q2 t array( "name" => "</div></div>",
a( S* q( h; J4 n "type" => "close",: X5 O, K) Z6 `6 I
),
( C: L, S* @) o2 ~
6 ?+ B9 ^! [# E" Q- O' {
4 {" j7 D6 c5 h2 D array( "name" => "AddThis Social Bookmarking Settings",
$ \1 U/ E+ m: f* M: J! W# V& C "type" => "heading",! S+ {' r4 W, ]
),7 l: A. q& q3 Z/ S& r1 ]# C7 Y) b! m
* z- H( S9 \ s0 Z
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>0 y" r' h# x6 U* ~1 z6 |) ?
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
$ ~( L/ T' Z9 p/ R2 y" w "id" => $shortname."_addthis",
$ C+ P$ K; n: Q" B "type" => "text",4 W/ k8 ]2 A& i( w( Y. i% W
"box" => "social",
D8 c# D \3 v" g/ s& w+ B; ? "std" => "",
7 v8 p6 K8 h* k ),8 g7 K) G2 O6 W% Z( M- |
/ v* |! _2 R! R2 i0 U$ _( ~" n array( "name" => "</div></div>",+ c: Y, u+ f S; U* F/ W6 A
"type" => "close"," c1 ~; ?+ X' [' G6 s5 ]8 e& y
),# V; f# O! c0 m/ n7 w. G8 {
8 `) W( u1 {% M/ D* s* @" Y* R
0 J' k0 n, E3 s
, m9 E: T2 `; d3 y* n# ^- m2 C3 D array( "name" => "YouTube Video Settings",. T0 F5 e1 T, o! y# n% ^5 l; a
"type" => "heading",
7 H: @. k7 a5 u ),2 d) L j( @6 m; Y
5 ~; U/ e2 G( V, g2 ^: _% E5 c
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- m7 i# Z8 A- @' V" m7 }5 e "id" => $shortname."_emvideo_activate",; F! _* v; r2 ?+ [: ^
"type" => "select",5 H& u# L9 m+ P5 H! w8 _9 x6 X7 d
"std" => "No",
6 |# x4 {+ ~$ Q! b) b "options" => array("No", "Yes")),
5 \! \$ l* P) s. j3 b% L& ]- Z$ d( f$ Z" S2 A
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>",$ Y1 o& o3 s% P* f
"id" => $shortname."_emvideo",
( [8 m; J. \# M | j$ i% ] "std" => "",
) i. P' U5 C9 ], i, r% { "type" => "text"),3 I1 D" k: q! @4 k: \% K. y' f
+ |0 {% A- W( C6 u: m( [2 d! ? array( "name" => "</div></div>",7 \4 Q$ w, s+ f, v* a
"type" => "close",
( B1 q+ X: H( ? ),9 l c: ]5 v2 E( l, d
* y) a( N5 X$ h' e, e, X! p array( "name" => "Twitter Settings",! O) v# P2 U1 h+ z
"type" => "heading",
, e! M: `2 p( g7 L& Q. ]4 V3 U ),
+ G+ a z8 o. N5 n3 q$ y# d/ A2 u/ M1 }
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",8 X8 m* v9 z/ H! i; ?
"id" => $shortname."_twitter_activate", R0 j% F. T) C8 P( h4 D' Y
"type" => "select",( X: F9 ~9 O0 D) D
"std" => "No",8 m$ D3 L! k% r: N. K, Z
"options" => array("No", "Yes")),- H; b$ ]' X+ P
+ f( @) P5 ?1 ?8 o0 e% f, |% M array( "name" => "Insert Your Twitter ID here
5 y; {2 _- G5 t5 a <br /><em>*leave blank if not necessary</em>
: }& F# [8 L( l+ t8 \' q <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
9 {. O0 O, l1 J( p "id" => $shortname."_twitter",% S8 W. K3 L* n/ i V5 n
"type" => "text",
$ V' {. f5 ^2 n$ I" \ "box" => "social",
7 z7 J, l' O5 d+ e "std" => "",( ?( B1 Q7 u% k
),
2 L/ g* V; O! Q, ~" @6 ^8 U% {/ |- `+ i5 p2 {, L+ F0 ~
array( "name" => "Enter Twitter Feed Count here
$ h. z } q2 {$ x: h <br /><em>*leave blank if not necessary</em>$ f A3 a$ ~, A9 Q9 U5 N4 v9 V
<br /><em>*Enter How Many Twitter Feed To Display</em>",
* y/ X/ t! Q7 P0 [- I "id" => $shortname."_twitter_count",; F/ K+ d" X: Y( l, y
"type" => "text",1 x5 B3 K1 a `- G- T) z6 d
"box" => "social",1 s; H& D, G! U) y$ g) n
"std" => "",
* N5 ]5 S$ L/ R5 D: R# X ),
9 R1 p% W C: q% S5 h# s5 l# ^
& D8 O3 K" q$ G! s/ Q! u& l* p array( "name" => "</div></div>",
4 `; ]+ a5 M. y. l& ` "type" => "close",5 D. `- W3 q5 B8 Y
),5 D6 C. W2 M1 L1 A2 [: e/ D$ A l
0 T$ I) R+ |/ u, O* Q) D8 f
% S A+ V3 H5 I9 P array( "name" => "125 x 125 Banners Advertisement Settings",2 {0 K2 Z! R$ F% X P5 b2 }5 L
"type" => "heading",, j! c- E* }9 U- a/ ~1 D
),4 V# t' D% a) |: }7 X, i% f
; Y0 X) w1 g* _
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
2 ^! \ d' P% Y$ E# P9 j/ k2 T- Q "id" => $shortname."_sponsor_activate",8 O0 h6 J# H+ A5 P( s1 a& I* U
"type" => "select",
$ i9 _$ Y9 A o% [" x. _7 W "std" => "No",
b. h5 D4 Z* z, m/ \ V "options" => array("No", "Yes")),
' k6 C8 m; H- s( k& T; c( I
0 H7 G! X$ i q( J" ^
$ g. q9 N8 j7 ? array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
2 n$ C% f" _+ M! c8 V+ s "id" => $shortname."_sponsor_banner_one",6 u: _, d! a8 e! S# o
"type" => "textarea",8 J d* U6 }6 |2 e% f
"std" => "",
4 m9 \7 q( z2 a9 Q ), - x# V8 ?6 N7 e$ y* L) @0 d2 G
7 B; x, z4 ^% J/ L* E
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",- ]# R* T; M$ v0 J0 ^
"id" => $shortname."_sponsor_banner_two",
8 x; ?! O# H) y. `9 o& Z( M8 T "type" => "textarea",8 }+ y# e. j; l* _& j8 x) L1 D# m
"std" => "",% _" B3 u2 {. \/ Q2 E* r
),
# x4 u+ i; f* \8 `' B
( } C' t% [- v$ S _9 Y array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
6 x! Z/ h4 |5 ~0 O0 f& O "id" => $shortname."_sponsor_banner_three",# ^$ ?" t0 |1 p( X: E# S0 \! E+ E- s
"type" => "textarea",
) n, n# q: Z9 h" R: p% r/ I "std" => "",6 D3 u! J% b9 [- V
),
2 O: l [( b: A; j9 P* D
1 a# e2 {# v# l7 c2 }9 L array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
; P0 ` o; }. F "id" => $shortname."_sponsor_banner_four",+ f8 h$ N% y$ x8 F% f( _4 X9 } X
"type" => "textarea",0 ?& V( j% z# ?7 F/ {2 K+ n
"std" => "",
2 C/ H8 }% K5 \( ?4 g* h ),7 R+ m# w4 v! D) `! a7 M
; a: X) J3 t$ i, v$ H5 ~
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",' N+ e) G# S' w# O6 e! \
"id" => $shortname."_sponsor_banner_five",. H* \7 ^* v& P2 w3 |/ ^+ G* A; S
"type" => "textarea",1 Q9 q% G0 v$ x6 E6 c, P* G. x+ |
"std" => "",( M; z$ S$ G3 \; s3 T( _1 {
),
/ v' s B; C7 o& K" { q! w) o `
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",& u: l; G0 I1 Z! o, t" d) B
"id" => $shortname."_sponsor_banner_six",
0 n/ F! ~ @" L8 r/ q# j "type" => "textarea",$ B1 Q4 c5 d, \
"std" => "",! z9 e1 c6 u4 a
),
0 ^* t7 N- t, q* Y- r; ?$ c$ y2 N0 Z% {6 u8 F/ A
array( "name" => "</div></div>",
: ~( d( S5 f/ w "type" => "close",9 X0 g- X0 e6 u8 l1 g* @
),
( c c m" D6 {+ O U) @" c
, m$ P- {6 [" w6 s6 u$ n+ A$ o; a
( r' z+ y+ S3 o1 k1 S4 X2 T9 g, H
); ?! S) q4 P- s2 V$ p1 I, ~
" m" h0 D& F7 _9 R4 A( M
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
( s2 `' I4 }% x: A7 b' a
2 K: v$ B c! W$ Wecho "<div id=\"admin-options\"> ";6 z& ^. O% T$ z2 a7 T1 c S' K6 N+ x
7 n0 x4 p2 G8 m
global $themename, $shortname, $options;
0 X6 R9 l- Y1 |3 hif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>'; \( q9 L# l7 Y" k! E
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';/ g, F2 W/ T& d* g# v
?>, B# D# _$ ~0 w9 n4 u" ~
Q# n c5 G& t6 Q<h4><?php echo "$themename"; ?> Theme Options</h4>3 \( {$ J" p1 Y/ T0 z9 _6 d- [
( m% h# f' Q* w<div class="annouce">
* a4 t$ w2 }7 E# |7 R<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>. I6 ]' a0 S8 s3 }1 M0 s
<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>! v: A, Y9 u) T# i. m# T
</div># C) F( I; T- {4 Z$ w2 O
/ |; V) a( n9 B4 m$ `7 D& f& n+ `<form action="" method="post">, i: n* w* O; |3 n3 q! U V+ Z6 m
+ c6 {- p8 W. a$ P1 m<?php foreach ($options as $value) { ?>; N. s- d; ?$ X! j1 D* d
" a) y( r; x: O, f) @* Y) C<?php switch ( $value['type'] ) { case 'heading': ?>
/ j# p, L# n, R6 J$ t6 y; I3 [/ p/ R0 n3 h
<div class="get-option">6 d* U0 i. m0 k- }2 b. K- h
2 [0 V$ [ O' k* ?. T4 X' `' S5 M<h2><?php echo $value['name']; ?></h2>
( L; j6 @1 b! u: u4 b7 L+ z- ^% w1 }+ F3 v) Z& F' T
<div class="option-save">
3 v# J1 {. _0 L! U8 k3 u
7 }; q. B! D9 w* H, e<?php/ C, g& G/ m6 M! p [3 B9 l$ C
break;
0 l4 B; _1 c1 X. tcase 'text':
% u, ?' J' n8 B4 @/ ]- t?>
/ a4 G7 w( w1 K q% m& X: j. i& S: z% v
<div class="description"><?php echo $value['name']; ?></div>1 P/ F" p8 q5 l+ U
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (1 A- y% Q6 w" {: Z$ n9 a% _ R
" ^* L% W3 b o0 H/ lget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
1 ?+ }# `- s6 j& U6 a8 l
& m8 ~/ ^* U1 ?7 i<?php
& T6 K+ F6 D8 a8 F' n8 B+ W) wbreak;
% l% x" w0 l# `case 'select':: z( O9 X+ o- g; W5 \% g2 {! ]
?>9 J3 R* u# l1 k2 u b
* L2 e. Q2 `' B& p5 |
<div class="description"><?php echo $value['name']; ?></div>
( B) q. U ?$ I/ Z6 Z! v<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">. ^1 G- Q6 h2 M- d; \/ {
<?php foreach ($value['options'] as $option) { ?>
; o! s+ s! N, A& [5 f1 s3 A2 \<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
6 U S1 @+ L& _5 R% L<?php } ?>
: t3 d; ] y$ y</select>
4 Y1 Q( r0 Q/ M0 K B( d0 Z/ X</p>
) f8 ~; H) X9 T l. ]1 n' K! n6 Y0 {# i7 }5 a( w5 o$ Q0 [
<?php
! r$ E9 f. d- [9 ?: a% bbreak;
7 G* o0 C. R( ~case 'textarea':
5 R0 y/ s# p: Y, _4 k! t1 z$valuex = $value['id'];
% S, ^/ R6 l/ s" Z8 V2 k$valuey = stripslashes($valuex);
) m+ T5 @7 w# p) Q$video_code = get_settings($valuey);9 d4 u; i4 Z; c
?>
* M" ~3 l2 y+ ^! L9 E1 `5 \4 ?
/ c, i. D" }7 H9 H0 Y# V T<div class="description"><?php echo $value['name']; ?></div>
& i; \9 {4 c3 C6 Q4 @<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }) Q& w0 h0 e4 b1 u& I3 @
9 P& X/ l1 B% r( t: z' Delse { echo $value['std']; } ?></textarea></p># r; m! F" h$ s6 Y4 q: n
% U8 F$ P' Z; I2 D5 r
<?php% y I$ i3 m& P9 d
break;
$ z0 p% j3 B n: X! Bcase 'close':
d! \- u) j8 i: U6 S+ ]: V( p?>. s# V8 ?' X( Y2 z/ p" g# ^
( b9 g! I2 z; Z0 b4 m) d% F
<div class="clearfix"></div>
. N: D( w$ F3 |2 w</div><!-- OPTION SAVE END -->
( x( s, s( [. ]$ w* X
4 l/ t+ e# l% J& \6 ?( J<div class="clearfix"></div>- x% T' }& |) k0 I' Q
</div><!-- GET OPTION END -->
0 C1 p( C9 I1 t# w* h* v9 ~$ k" E8 G8 |' C! \) `7 _4 s
<?php
, s5 s$ j T5 Mbreak;
4 t# d0 Z! [0 Q1 s# mdefault;$ U0 M; S4 c4 u3 G) n" F j6 {
?>
, h4 B" p/ l3 ]% \9 Q8 M% l5 J( ?# F
0 Z1 ?6 @/ f$ A, |) j( B' ^7 L8 O* ?
+ u3 R- U0 s( G& a. u$ d<?php
0 u# u, Z. a6 ^9 |( Qbreak; } ?>2 K6 N# j- u2 i0 K
B# k: d% I l<?php } ?>& e+ ], _1 S. z. k% c1 N9 {
4 q- F! E$ H- z
<p class="save-p">0 X7 {9 a$ v" V \3 A9 ~
<input name="save" type="submit" class="sbutton" value="Save Options" />
6 K+ ~% J- M# f% [1 H<input type="hidden" name="action" value="save" />2 w, Q' m/ z6 x: N+ H
</p>+ {3 u* d* N7 f/ E
</form>
: _* R! r4 i! X7 F! g+ M C2 `: G8 q5 E' ~' r/ o# c' o9 ^
<form method="post">
/ _% E8 [! B/ G3 q/ I' W<p class="save-p">' ?- i$ p. w4 B5 c& G3 }
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
3 C) @3 [* U; Z$ z" o F4 C& p<input type="hidden" name="action" value="reset" />4 _ E* c0 O0 f' E0 p; k
</p>5 z6 L7 H. G; J" Z2 u* i$ p
</form>
( ]4 s6 B0 u2 i6 W7 v1 Q; Z( h1 h2 j# I6 q/ A ]: Y
</div><!-- ADMIN OPTIONS END --># M i K# z$ A3 M! K1 S. B
5 a# R3 v G: p( L. q* _
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }3 E3 r% q4 m* `% x1 t
$ o$ Z. d% V( a/ h# g7 o1 ? ~
function mytheme_admin_register() {5 }8 K1 f; Y l2 b/ X! Q
global $themename, $shortname, $options;7 u4 B2 n# U& f
if ( $_GET['page'] == basename(__FILE__) ) {0 l8 M+ D& H' Z/ e& ?3 g
if ( 'save' == $_REQUEST['action'] ) {
8 ^9 ] P, A% G1 |1 rforeach ($options as $value) {
3 D, \3 a z* p0 N# {, j4 [update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }1 J0 Z- c5 R1 P
foreach ($options as $value) {
J8 K' Y8 l. f1 Tif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }/ I4 k# b9 @0 k, z" f
header("Location: themes.php?page=functions.php&saved=true");/ N$ {2 u" @9 Y& z
die;! H( m3 L& K! H0 H4 l
} else if( 'reset' == $_REQUEST['action'] ) {
- b; I% W) Y: |( \foreach ($options as $value) {+ U) L: E% q* I; C
delete_option( $value['id'] ); }9 I& v, i7 X2 [$ B
header("Location: themes.php?page=functions.php&reset=true");
% S4 T4 n& P8 [' M sdie;
5 g' c/ a" n1 K0 H/ q' t! N}
; a8 S2 w% O* W8 ~3 O! j}
1 D! e% Y0 y5 e, h Vadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');! K/ m% Q* ~/ W+ z% v1 L* K* d7 d' |& k
}: z% z4 Y, d$ e8 s7 d) S
$ a9 S4 t! ~, e# H" Y7 \) ^& s
function mytheme_admin_head() { ?>! f+ r* ~: p& L4 V( L- s6 Y- l
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
8 u1 y+ Y3 F9 z. O# o) I+ j<?php }
/ m3 K+ k- b* C6 s% H' t4 Y |
|