|
|

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