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