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