|
|

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