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