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