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