|
|

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