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