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