|
|

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