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