|
|

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